From 1ef8aa499c411981a7dd4bab7ee37daadbf58ebc Mon Sep 17 00:00:00 2001 From: Google GitHub Actions Bot <72759630+google-github-actions-bot@users.noreply.github.com> Date: Sat, 22 Jan 2022 13:35:08 -0500 Subject: [PATCH] chore: build dist release-please-action (#424) --- dist/index.js | 147842 +++++++++++++++++++++++++---------------------- 1 file changed, 77417 insertions(+), 70425 deletions(-) diff --git a/dist/index.js b/dist/index.js index 06f84541..817278e1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -44,7 +44,7 @@ async function runManifest (command) { const { fork } = getGitHubInput() const manifestOpts = getManifestInput() const github = await getGitHubInstance() - const manifest = await Manifest.fromManifest( + let manifest = await Manifest.fromManifest( github, github.repository.defaultBranch, manifestOpts.configFile, @@ -56,8 +56,19 @@ async function runManifest (command) { ) // Create or update release PRs: outputPRs(await manifest.createPullRequests()) - if (command === 'manifest-pr') return - outputReleases(await manifest.createReleases()) + if (command !== 'manifest-pr') { + manifest = await Manifest.fromManifest( + github, + github.repository.defaultBranch, + manifestOpts.configFile, + manifestOpts.manifestFile, + { + signoff, + fork + } + ) + outputReleases(await manifest.createReleases()) + } } async function main () { @@ -65,7 +76,42 @@ async function main () { if (MANIFEST_COMMANDS.includes(command)) { return await runManifest(command) } + const github = await getGitHubInstance() + + // First we check for any merged release PRs (PRs merged with the label + // "autorelease: pending"): + if (!command || command === GITHUB_RELEASE_COMMAND) { + const manifest = await manifestInstance(github) + outputReleases(await manifest.createReleases()) + } + + // Next we check for PRs merged since the last release, and groom the + // release PR: + if (!command || command === GITHUB_RELEASE_PR_COMMAND) { + const manifest = await manifestInstance(github) + outputPRs(await manifest.createPullRequests()) + } +} + +const releasePlease = { + main +} + +function getGitHubInstance () { + const { token, defaultBranch, apiUrl, graphqlUrl, repoUrl } = getGitHubInput() + const [owner, repo] = repoUrl.split('/') + const githubCreateOpts = { + owner, + repo, + apiUrl, + graphqlUrl, + token + } + if (defaultBranch) githubCreateOpts.defaultBranch = defaultBranch + return GitHub.create(githubCreateOpts) +} +async function manifestInstance (github) { const { fork } = getGitHubInput() const bumpMinorPreMajor = core.getBooleanInput('bump-minor-pre-major') const bumpPatchForMinorPreMajor = core.getBooleanInput('bump-patch-for-minor-pre-major') @@ -78,11 +124,10 @@ async function main () { const changelogSections = changelogTypes && JSON.parse(changelogTypes) const versionFile = core.getInput('version-file') || undefined const extraFiles = core.getMultilineInput('extra-files') || undefined - const github = await getGitHubInstance() const pullRequestTitlePattern = core.getInput('pull-request-title-pattern') || undefined const draft = core.getBooleanInput('draft') const draftPullRequest = core.getBooleanInput('draft-pull-request') - const manifest = await Manifest.fromConfig( + return await Manifest.fromConfig( github, github.repository.defaultBranch, { @@ -105,36 +150,6 @@ async function main () { }, path ) - - // First we check for any merged release PRs (PRs merged with the label - // "autorelease: pending"): - if (!command || command === GITHUB_RELEASE_COMMAND) { - outputReleases(await manifest.createReleases()) - } - - // Next we check for PRs merged since the last release, and groom the - // release PR: - if (!command || command === GITHUB_RELEASE_PR_COMMAND) { - outputPRs(await manifest.createPullRequests()) - } -} - -const releasePlease = { - main -} - -function getGitHubInstance () { - const { token, defaultBranch, apiUrl, graphqlUrl, repoUrl } = getGitHubInput() - const [owner, repo] = repoUrl.split('/') - const githubCreateOpts = { - owner, - repo, - apiUrl, - graphqlUrl, - token - } - if (defaultBranch) githubCreateOpts.defaultBranch = defaultBranch - return GitHub.create(githubCreateOpts) } function outputReleases (releases) { @@ -1644,9 +1659,9 @@ function _default(rawLines, lineNumber, colNumber, opts = {}) { Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isIdentifierStart = isIdentifierStart; exports.isIdentifierChar = isIdentifierChar; exports.isIdentifierName = isIdentifierName; +exports.isIdentifierStart = isIdentifierStart; let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); @@ -1735,16 +1750,16 @@ function isIdentifierName(name) { Object.defineProperty(exports, "__esModule", ({ value: true })); -Object.defineProperty(exports, "isIdentifierName", ({ +Object.defineProperty(exports, "isIdentifierChar", ({ enumerable: true, get: function () { - return _identifier.isIdentifierName; + return _identifier.isIdentifierChar; } })); -Object.defineProperty(exports, "isIdentifierChar", ({ +Object.defineProperty(exports, "isIdentifierName", ({ enumerable: true, get: function () { - return _identifier.isIdentifierChar; + return _identifier.isIdentifierName; } })); Object.defineProperty(exports, "isIdentifierStart", ({ @@ -1753,6 +1768,12 @@ Object.defineProperty(exports, "isIdentifierStart", ({ return _identifier.isIdentifierStart; } })); +Object.defineProperty(exports, "isKeyword", ({ + enumerable: true, + get: function () { + return _keyword.isKeyword; + } +})); Object.defineProperty(exports, "isReservedWord", ({ enumerable: true, get: function () { @@ -1777,12 +1798,6 @@ Object.defineProperty(exports, "isStrictReservedWord", ({ return _keyword.isStrictReservedWord; } })); -Object.defineProperty(exports, "isKeyword", ({ - enumerable: true, - get: function () { - return _keyword.isKeyword; - } -})); var _identifier = __nccwpck_require__(66396); @@ -1799,11 +1814,11 @@ var _keyword = __nccwpck_require__(47249); Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isKeyword = isKeyword; exports.isReservedWord = isReservedWord; -exports.isStrictReservedWord = isStrictReservedWord; exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; exports.isStrictBindReservedWord = isStrictBindReservedWord; -exports.isKeyword = isKeyword; +exports.isStrictReservedWord = isStrictReservedWord; const reservedWords = { keyword: ["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"], strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], @@ -1947,7 +1962,7 @@ function getChalk(options) { } function highlight(code, options = {}) { - if (shouldHighlight(options)) { + if (code !== "" && shouldHighlight(options)) { const chalk = getChalk(options); const defs = getDefs(chalk); return highlightTokens(defs, code); @@ -2137,7 +2152,7 @@ Object.defineProperty(module, 'exports', { "use strict"; -const escapeStringRegexp = __nccwpck_require__(98691); +const escapeStringRegexp = __nccwpck_require__(25898); const ansiStyles = __nccwpck_require__(96538); const stdoutColor = __nccwpck_require__(95317).stdout; @@ -3726,6 +3741,25 @@ module.exports = { }; +/***/ }), + +/***/ 25898: +/***/ ((module) => { + +"use strict"; + + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; + + /***/ }), /***/ 33226: @@ -7247,7 +7281,7 @@ module.exports.CyclicPackageGraphNode = CyclicPackageGraphNode; "use strict"; -const semver = __nccwpck_require__(11383); +const semver = __nccwpck_require__(71075); const { prereleaseIdFromVersion } = __nccwpck_require__(24329); const PKG = Symbol("pkg"); @@ -7346,79893 +7380,85214 @@ function reportCycles(paths, rejectCycles) { /***/ }), -/***/ 48628: +/***/ 3298: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; - - -const npa = __nccwpck_require__(32695); -const path = __nccwpck_require__(85622); -const loadJsonFile = __nccwpck_require__(75978); -const writePkg = __nccwpck_require__(16440); - -// symbol used to "hide" internal state -const PKG = Symbol("pkg"); - -/* eslint-disable no-underscore-dangle */ - -// private fields -const _location = Symbol("location"); -const _resolved = Symbol("resolved"); -const _rootPath = Symbol("rootPath"); -const _scripts = Symbol("scripts"); -const _contents = Symbol("contents"); +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + constructor (comp, options) { + options = parseOptions(options) -/** - * @param {import("npm-package-arg").Result} result - */ -function binSafeName({ name, scope }) { - return scope ? name.substring(scope.length + 1) : name; -} + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } -// package.json files are not that complicated, so this is intentionally naïve -function shallowCopy(json) { - return Object.keys(json).reduce((obj, key) => { - const val = json[key]; + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) - /* istanbul ignore if */ - if (Array.isArray(val)) { - obj[key] = val.slice(); - } else if (val && typeof val === "object") { - obj[key] = Object.assign({}, val); + if (this.semver === ANY) { + this.value = '' } else { - obj[key] = val; + this.value = this.operator + this.semver.version } - return obj; - }, {}); -} - -/** - * @typedef {object} RawManifest The subset of package.json properties that Lerna uses - * @property {string} name - * @property {string} version - * @property {boolean} [private] - * @property {Record|string} [bin] - * @property {Record} [scripts] - * @property {Record} [dependencies] - * @property {Record} [devDependencies] - * @property {Record} [optionalDependencies] - * @property {Record} [peerDependencies] - * @property {Record<'directory' | 'registry' | 'tag', string>} [publishConfig] - * @property {string[] | { packages: string[] }} [workspaces] - */ + debug('comp', this) + } -/** - * Lerna's internal representation of a local package, with - * many values resolved directly from the original JSON. - */ -class Package { - /** - * Create a Package instance from parameters, possibly reusing existing instance. - * @param {string|Package|RawManifest} ref A path to a package.json file, Package instance, or JSON object - * @param {string} [dir] If `ref` is a JSON object, this is the location of the manifest - * @returns {Package} - */ - static lazy(ref, dir = ".") { - if (typeof ref === "string") { - const location = path.resolve(path.basename(ref) === "package.json" ? path.dirname(ref) : ref); - const manifest = loadJsonFile.sync(path.join(location, "package.json")); + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) - return new Package(manifest, location); + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) } - // don't use instanceof because it fails across nested module boundaries - if ("__isLernaPackage" in ref) { - return ref; + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' } - // assume ref is a json object - return new Package(ref, dir); + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } } - /** - * @param {RawManifest} pkg - * @param {string} location - * @param {string} [rootPath] - */ - constructor(pkg, location, rootPath = location) { - // npa will throw an error if the name is invalid - const resolved = npa.resolve(pkg.name, `file:${path.relative(rootPath, location)}`, rootPath); + toString () { + return this.value + } - this.name = pkg.name; - this[PKG] = pkg; + test (version) { + debug('Comparator.test', version, this.options.loose) - // omit raw pkg from default util.inspect() output, but preserve internal mutability - Object.defineProperty(this, PKG, { enumerable: false, writable: true }); + if (this.semver === ANY || version === ANY) { + return true + } - this[_location] = location; - this[_resolved] = resolved; - this[_rootPath] = rootPath; - this[_scripts] = { ...pkg.scripts }; - } + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } - // readonly getters - get location() { - return this[_location]; + return cmp(version, this.operator, this.semver, this.options) } - get private() { - return Boolean(this[PKG].private); - } + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } - get resolved() { - return this[_resolved]; - } + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } - get rootPath() { - return this[_rootPath]; - } + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } - get scripts() { - return this[_scripts]; - } + const sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + const sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + const sameSemVer = this.semver.version === comp.semver.version + const differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + const oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<') + const oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>') - get bin() { - const pkg = this[PKG]; - return typeof pkg.bin === "string" - ? { - [binSafeName(this.resolved)]: pkg.bin, - } - : Object.assign({}, pkg.bin); + return ( + sameDirectionIncreasing || + sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || + oppositeDirectionsGreaterThan + ) } +} - get binLocation() { - return path.join(this.location, "node_modules", ".bin"); - } +module.exports = Comparator - get manifestLocation() { - return path.join(this.location, "package.json"); - } +const parseOptions = __nccwpck_require__(29508) +const {re, t} = __nccwpck_require__(44630) +const cmp = __nccwpck_require__(33455) +const debug = __nccwpck_require__(51250) +const SemVer = __nccwpck_require__(97414) +const Range = __nccwpck_require__(76639) - get nodeModulesLocation() { - return path.join(this.location, "node_modules"); - } - // eslint-disable-next-line class-methods-use-this - get __isLernaPackage() { - // safer than instanceof across module boundaries - return true; - } +/***/ }), - // accessors - get version() { - return this[PKG].version; - } +/***/ 76639: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - set version(version) { - this[PKG].version = version; - } +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) - get contents() { - // if modified with setter, use that value - if (this[_contents]) { - return this[_contents]; + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } } - // if provided by pkg.publishConfig.directory value - if (this[PKG].publishConfig && this[PKG].publishConfig.directory) { - return path.join(this.location, this[PKG].publishConfig.directory); + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this } - // default to package root - return this.location; - } + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease - set contents(subDirectory) { - this[_contents] = path.join(this.location, subDirectory); - } + // First, split based on boolean or || + this.raw = range + this.set = range + .split(/\s*\|\|\s*/) + // map the range to a 2d array of comparators + .map(range => this.parseRange(range.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) - // "live" collections - get dependencies() { - return this[PKG].dependencies; - } + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${range}`) + } - get devDependencies() { - return this[PKG].devDependencies; - } + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) + this.set = [first] + else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } - get optionalDependencies() { - return this[PKG].optionalDependencies; + this.format() } - get peerDependencies() { - return this[PKG].peerDependencies; + format () { + this.range = this.set + .map((comps) => { + return comps.join(' ').trim() + }) + .join('||') + .trim() + return this.range } - /** - * Map-like retrieval of arbitrary values - * @template {keyof RawManifest} K - * @param {K} key field name to retrieve value - * @returns {RawManifest[K]} value stored under key, if present - */ - get(key) { - return this[PKG][key]; + toString () { + return this.range } - /** - * Map-like storage of arbitrary values - * @template {keyof RawManifest} K - * @param {T} key field name to store value - * @param {RawManifest[K]} val value to store - * @returns {Package} instance for chaining - */ - set(key, val) { - this[PKG][key] = val; + parseRange (range) { + range = range.trim() - return this; - } + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = Object.keys(this.options).join(',') + const memoKey = `parseRange:${memoOpts}:${range}` + const cached = cache.get(memoKey) + if (cached) + return cached - /** - * Provide shallow copy for munging elsewhere - * @returns {Object} - */ - toJSON() { - return shallowCopy(this[PKG]); - } + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) - /** - * Refresh internal state from disk (e.g., changed by external lifecycles) - */ - refresh() { - return loadJsonFile(this.manifestLocation).then((pkg) => { - this[PKG] = pkg; + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - return this; - }); - } + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) - /** - * Write manifest changes to disk - * @returns {Promise} resolves when write finished - */ - serialize() { - return writePkg(this.manifestLocation, this[PKG]).then(() => this); - } + // normalize spaces + range = range.split(/\s+/).join(' ') - /** - * Mutate local dependency spec according to type - * @param {Object} resolved npa metadata - * @param {String} depVersion semver - * @param {String} savePrefix npm_config_save_prefix - */ - updateLocalDependency(resolved, depVersion, savePrefix) { - const depName = resolved.name; + // At this point, the range is completely trimmed and + // ready to be split into comparators. - // first, try runtime dependencies - let depCollection = this.dependencies; + const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + // in loose mode, throw out any that are not valid comparators + .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) + .map(comp => new Comparator(comp, this.options)) - // try optionalDependencies if that didn't work - if (!depCollection || !depCollection[depName]) { - depCollection = this.optionalDependencies; + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const l = rangeList.length + const rangeMap = new Map() + for (const comp of rangeList) { + if (isNullSet(comp)) + return [comp] + rangeMap.set(comp.value, comp) } + if (rangeMap.size > 1 && rangeMap.has('')) + rangeMap.delete('') - // fall back to devDependencies - if (!depCollection || !depCollection[depName]) { - depCollection = this.devDependencies; + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') } - if (resolved.registry || resolved.type === "directory") { - // a version (1.2.3) OR range (^1.2.3) OR directory (file:../foo-pkg) - depCollection[depName] = `${savePrefix}${depVersion}`; - } else if (resolved.gitCommittish) { - // a git url with matching committish (#v1.2.3 or #1.2.3) - const [tagPrefix] = /^\D*/.exec(resolved.gitCommittish); + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } - // update committish - const { hosted } = resolved; // take that, lint! - hosted.committish = `${tagPrefix}${depVersion}`; + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } - // always serialize the full url (identical to previous resolved.saveSpec) - depCollection[depName] = hosted.toString({ noGitPlus: false, noCommittish: false }); - } else if (resolved.gitRange) { - // a git url with matching gitRange (#semver:^1.2.3) - const { hosted } = resolved; // take that, lint! - hosted.committish = `semver:${savePrefix}${depVersion}`; + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } - // always serialize the full url (identical to previous resolved.saveSpec) - depCollection[depName] = hosted.toString({ noGitPlus: false, noCommittish: false }); + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } } + return false } } +module.exports = Range -module.exports.Package = Package; - +const LRU = __nccwpck_require__(7129) +const cache = new LRU({ max: 1000 }) -/***/ }), +const parseOptions = __nccwpck_require__(29508) +const Comparator = __nccwpck_require__(3298) +const debug = __nccwpck_require__(51250) +const SemVer = __nccwpck_require__(97414) +const { + re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace +} = __nccwpck_require__(44630) -/***/ 24329: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' -"use strict"; +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) -const semver = __nccwpck_require__(11383); + testComparator = remainingComparators.pop() + } -module.exports.prereleaseIdFromVersion = prereleaseIdFromVersion; + return result +} -/** - * @param {string} version - * @returns {string|undefined} - */ -function prereleaseIdFromVersion(version) { - return (semver.prerelease(version) || []).shift(); +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp } +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' -/***/ }), +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +const replaceTildes = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceTilde(comp, options) + }).join(' ') -/***/ 53961: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret -"use strict"; + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + debug('tilde return', ret) + return ret + }) +} -const log = __nccwpck_require__(64314); +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +const replaceCarets = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceCaret(comp, options) + }).join(' ') -class ValidationError extends Error { - constructor(prefix, message, ...rest) { - super(message); - this.name = "ValidationError"; - this.prefix = prefix; - log.resume(); // might be paused, noop otherwise - log.error(prefix, message, ...rest); - } +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) } -module.exports.ValidationError = ValidationError; +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map((comp) => { + return replaceXRange(comp, options) + }).join(' ') +} +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp -/***/ }), + if (gtlt === '=' && anyX) { + gtlt = '' + } -/***/ 40334: -/***/ ((__unused_webpack_module, exports) => { + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' -"use strict"; + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (gtlt === '<') + pr = '-0' -const REGEX_IS_INSTALLATION_LEGACY = /^v1\./; -const REGEX_IS_INSTALLATION = /^ghs_/; -const REGEX_IS_USER_TO_SERVER = /^ghu_/; -async function auth(token) { - const isApp = token.split(/\./).length === 3; - const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); - const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); - const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; - return { - type: "token", - token: token, - tokenType - }; -} + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } -/** - * Prefix token for usage in the Authorization header - * - * @param token OAuth token or JSON Web Token - */ -function withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } + debug('xRange return', ret) - return `token ${token}`; + return ret + }) } -async function hook(token, request, route, parameters) { - const endpoint = request.endpoint.merge(route, parameters); - endpoint.headers.authorization = withAuthorizationPrefix(token); - return request(endpoint); +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], '') } -const createTokenAuth = function createTokenAuth(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp.trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} - if (typeof token !== "string") { - throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` } - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); -}; + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } -exports.createTokenAuth = createTokenAuth; -//# sourceMappingURL=index.js.map + return (`${from} ${to}`).trim() +} +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } -/***/ }), + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } -/***/ 76762: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } -"use strict"; + // Version has a -pre, but it's not one of the ones we like. + return false + } + return true +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -var universalUserAgent = __nccwpck_require__(45030); -var beforeAfterHook = __nccwpck_require__(83682); -var request = __nccwpck_require__(36234); -var graphql = __nccwpck_require__(88467); -var authToken = __nccwpck_require__(40334); +/***/ }), -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; +/***/ 97414: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } +const debug = __nccwpck_require__(51250) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(10969) +const { re, t } = __nccwpck_require__(44630) - return target; -} +const parseOptions = __nccwpck_require__(29508) +const { compareIdentifiers } = __nccwpck_require__(95783) +class SemVer { + constructor (version, options) { + options = parseOptions(options) -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid Version: ${version}`) + } - var target = _objectWithoutPropertiesLoose(source, excluded); + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } - var key, i; + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - for (i = 0; i < sourceSymbolKeys.length; i++) { - key = sourceSymbolKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; - target[key] = source[key]; + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) } - } - - return target; -} -const VERSION = "3.5.1"; + this.raw = version -const _excluded = ["authStrategy"]; -class Octokit { - constructor(options = {}) { - const hook = new beforeAfterHook.Collection(); - const requestDefaults = { - baseUrl: request.request.endpoint.DEFAULTS.baseUrl, - headers: {}, - request: Object.assign({}, options.request, { - // @ts-ignore internal usage only, no need to type - hook: hook.bind(null, "request") - }), - mediaType: { - previews: [], - format: "" - } - }; // prepend default user agent with `options.userAgent` if set + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] - requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') } - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') } - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) } - this.request = request.request.defaults(requestDefaults); - this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); - this.log = Object.assign({ - debug: () => {}, - info: () => {}, - warn: console.warn.bind(console), - error: console.error.bind(console) - }, options.log); - this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance - // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. - // (2) If only `options.auth` is set, use the default token authentication strategy. - // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. - // TODO: type `options.auth` based on `options.authStrategy`. + this.build = m[5] ? m[5].split('.') : [] + this.format() + } - if (!options.authStrategy) { - if (!options.auth) { - // (1) - this.auth = async () => ({ - type: "unauthenticated" - }); - } else { - // (2) - const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } - hook.wrap("request", auth.hook); - this.auth = auth; + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 } - } else { - const { - authStrategy - } = options, - otherOptions = _objectWithoutProperties(options, _excluded); + other = new SemVer(other, this.options) + } - const auth = authStrategy(Object.assign({ - request: this.request, - log: this.log, - // we pass the current octokit instance as well as its constructor options - // to allow for authentication strategies that return a new octokit instance - // that shares the same internal state as the current one. The original - // requirement for this was the "event-octokit" authentication strategy - // of https://github.com/probot/octokit-auth-probot. - octokit: this, - octokitOptions: otherOptions - }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ + if (other.version === this.version) { + return 0 + } - hook.wrap("request", auth.hook); - this.auth = auth; - } // apply plugins - // https://stackoverflow.com/a/16345172 + return this.compareMain(other) || this.comparePre(other) + } + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - const classConstructor = this.constructor; - classConstructor.plugins.forEach(plugin => { - Object.assign(this, plugin(this, options)); - }); + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) } - static defaults(defaults) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - if (typeof defaults === "function") { - super(defaults(options)); - return; - } + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } - super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { - userAgent: `${options.userAgent} ${defaults.userAgent}` - } : null)); + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) } + } while (++i) + } - }; - return OctokitWithDefaults; + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) } - /** - * Attach a plugin (or many) to your Octokit instance. - * - * @example - * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) - */ + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break - static plugin(...newPlugins) { - var _a; + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break - const currentPlugins = this.plugins; - const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); - return NewOctokit; + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.format() + this.raw = this.version + return this } - } -Octokit.VERSION = VERSION; -Octokit.plugins = []; -exports.Octokit = Octokit; -//# sourceMappingURL=index.js.map +module.exports = SemVer /***/ }), -/***/ 59440: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 36218: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const parse = __nccwpck_require__(81854) +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ }), -var isPlainObject = __nccwpck_require__(63287); -var universalUserAgent = __nccwpck_require__(45030); +/***/ 33455: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function lowercaseKeys(object) { - if (!object) { - return {}; - } +const eq = __nccwpck_require__(66535) +const neq = __nccwpck_require__(19838) +const gt = __nccwpck_require__(17880) +const gte = __nccwpck_require__(70162) +const lt = __nccwpck_require__(11420) +const lte = __nccwpck_require__(49299) - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[key]; - return newObj; - }, {}); -} +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b -function mergeDeep(defaults, options) { - const result = Object.assign({}, defaults); - Object.keys(options).forEach(key => { - if (isPlainObject.isPlainObject(options[key])) { - if (!(key in defaults)) Object.assign(result, { - [key]: options[key] - });else result[key] = mergeDeep(defaults[key], options[key]); - } else { - Object.assign(result, { - [key]: options[key] - }); - } - }); - return result; -} + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b -function removeUndefinedProperties(obj) { - for (const key in obj) { - if (obj[key] === undefined) { - delete obj[key]; - } - } + case '': + case '=': + case '==': + return eq(a, b, loose) - return obj; -} + case '!=': + return neq(a, b, loose) -function merge(defaults, route, options) { - if (typeof route === "string") { - let [method, url] = route.split(" "); - options = Object.assign(url ? { - method, - url - } : { - url: method - }, options); - } else { - options = Object.assign({}, route); - } // lowercase header names before merging with defaults to avoid duplicates + case '>': + return gt(a, b, loose) + case '>=': + return gte(a, b, loose) - options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging + case '<': + return lt(a, b, loose) - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten + case '<=': + return lte(a, b, loose) - if (defaults && defaults.mediaType.previews.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); + default: + throw new TypeError(`Invalid operator: ${op}`) } - - mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); - return mergedOptions; } +module.exports = cmp -function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); - if (names.length === 0) { - return url; +/***/ }), + +/***/ 78851: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(97414) +const parse = __nccwpck_require__(81854) +const {re, t} = __nccwpck_require__(44630) + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version } - return url + separator + names.map(name => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + let next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); + if (match === null) + return null + + return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } +module.exports = coerce -const urlVariableRegex = /\{[^}]+\}/g; -function removeNonChars(variableName) { - return variableName.replace(/^\W+|\W+$/g, "").split(/,/); +/***/ }), + +/***/ 58912: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(97414) +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) } +module.exports = compareBuild -function extractUrlVariableNames(url) { - const matches = url.match(urlVariableRegex); - if (!matches) { - return []; - } +/***/ }), - return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); -} +/***/ 34965: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function omit(object, keysToOmit) { - return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { - obj[key] = object[key]; - return obj; - }, {}); -} +const compare = __nccwpck_require__(86978) +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose -// Based on https://github.com/bramstein/url-template, licensed under BSD -// TODO: create separate package. -// -// Copyright (c) 2012-2014, Bram Stein -// All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* istanbul ignore file */ -function encodeReserved(str) { - return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { - if (!/%[0-9A-Fa-f]/.test(part)) { - part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); - } - - return part; - }).join(""); -} - -function encodeUnreserved(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return "%" + c.charCodeAt(0).toString(16).toUpperCase(); - }); -} - -function encodeValue(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - if (key) { - return encodeUnreserved(key) + "=" + value; - } else { - return value; - } -} +/***/ }), -function isDefined(value) { - return value !== undefined && value !== null; -} +/***/ 86978: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; -} +const SemVer = __nccwpck_require__(97414) +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) -function getValues(context, operator, key, modifier) { - var value = context[key], - result = []; +module.exports = compare - if (isDefined(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - value = value.toString(); - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } +/***/ }), - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } - } else { - const tmp = []; +/***/ 81246: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (Array.isArray(value)) { - value.filter(isDefined).forEach(function (value) { - tmp.push(encodeValue(operator, value)); - }); - } else { - Object.keys(value).forEach(function (k) { - if (isDefined(value[k])) { - tmp.push(encodeUnreserved(k)); - tmp.push(encodeValue(operator, value[k].toString())); - } - }); - } +const parse = __nccwpck_require__(81854) +const eq = __nccwpck_require__(66535) - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); - } - } - } +const diff = (version1, version2) => { + if (eq(version1, version2)) { + return null } else { - if (operator === ";") { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); + const v1 = parse(version1) + const v2 = parse(version2) + const hasPre = v1.prerelease.length || v2.prerelease.length + const prefix = hasPre ? 'pre' : '' + const defaultResult = hasPre ? 'prerelease' : '' + for (const key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); } + return defaultResult // may be undefined } - - return result; } +module.exports = diff -function parseUrl(template) { - return { - expand: expand.bind(null, template) - }; -} -function expand(template, context) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { - if (expression) { - let operator = ""; - const values = []; +/***/ }), - if (operators.indexOf(expression.charAt(0)) !== -1) { - operator = expression.charAt(0); - expression = expression.substr(1); - } +/***/ 66535: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - expression.split(/,/g).forEach(function (variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); - }); +const compare = __nccwpck_require__(86978) +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq - if (operator && operator !== "+") { - var separator = ","; - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; - } +/***/ }), - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved(literal); - } - }); -} +/***/ 17880: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function parse(options) { - // https://fetch.spec.whatwg.org/#methods - let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible +const compare = __nccwpck_require__(86978) +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt - let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); - let headers = Object.assign({}, options.headers); - let body; - let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later - const urlVariableNames = extractUrlVariableNames(url); - url = parseUrl(url).expand(parameters); +/***/ }), - if (!/^http/.test(url)) { - url = options.baseUrl + url; - } +/***/ 70162: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); - const remainingParameters = omit(parameters, omittedParameters); - const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); +const compare = __nccwpck_require__(86978) +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte - if (!isBinaryRequest) { - if (options.mediaType.format) { - // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw - headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); - } - if (options.mediaType.previews.length) { - const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; - headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { - const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; - return `application/vnd.github.${preview}-preview${format}`; - }).join(","); - } - } // for GET/HEAD requests, set URL query parameters from remaining parameters - // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters +/***/ }), +/***/ 99798: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (["GET", "HEAD"].includes(method)) { - url = addQueryParameters(url, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; - } else { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; - } else { - headers["content-length"] = 0; - } - } - } // default content-type for JSON if body is set +const SemVer = __nccwpck_require__(97414) +const inc = (version, release, options, identifier) => { + if (typeof (options) === 'string') { + identifier = options + options = undefined + } - if (!headers["content-type"] && typeof body !== "undefined") { - headers["content-type"] = "application/json; charset=utf-8"; - } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. - // fetch does not allow to set `content-length` header, but we can set body to an empty string + try { + return new SemVer(version, options).inc(release, identifier).version + } catch (er) { + return null + } +} +module.exports = inc - if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } // Only return body/request keys if present +/***/ }), +/***/ 11420: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return Object.assign({ - method, - url, - headers - }, typeof body !== "undefined" ? { - body - } : null, options.request ? { - request: options.request - } : null); -} +const compare = __nccwpck_require__(86978) +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt -function endpointWithDefaults(defaults, route, options) { - return parse(merge(defaults, route, options)); -} -function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS = merge(oldDefaults, newDefaults); - const endpoint = endpointWithDefaults.bind(null, DEFAULTS); - return Object.assign(endpoint, { - DEFAULTS, - defaults: withDefaults.bind(null, DEFAULTS), - merge: merge.bind(null, DEFAULTS), - parse - }); -} +/***/ }), -const VERSION = "6.0.12"; +/***/ 49299: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. -// So we use RequestParameters and add method as additional required property. +const compare = __nccwpck_require__(86978) +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte -const DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "", - previews: [] - } -}; -const endpoint = withDefaults(null, DEFAULTS); +/***/ }), -exports.endpoint = endpoint; -//# sourceMappingURL=index.js.map +/***/ 61925: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(97414) +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major /***/ }), -/***/ 88467: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 35519: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const SemVer = __nccwpck_require__(97414) +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ }), -var request = __nccwpck_require__(36234); -var universalUserAgent = __nccwpck_require__(45030); +/***/ 19838: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const VERSION = "4.8.0"; +const compare = __nccwpck_require__(86978) +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq -function _buildMessageForResponseErrors(data) { - return `Request failed due to following response errors:\n` + data.errors.map(e => ` - ${e.message}`).join("\n"); -} -class GraphqlResponseError extends Error { - constructor(request, headers, response) { - super(_buildMessageForResponseErrors(response)); - this.request = request; - this.headers = headers; - this.response = response; - this.name = "GraphqlResponseError"; // Expose the errors and response data in their shorthand properties. +/***/ }), - this.errors = response.errors; - this.data = response.data; // Maintains proper stack trace (only available on V8) +/***/ 81854: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /* istanbul ignore next */ +const {MAX_LENGTH} = __nccwpck_require__(10969) +const { re, t } = __nccwpck_require__(44630) +const SemVer = __nccwpck_require__(97414) - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } +const parseOptions = __nccwpck_require__(29508) +const parse = (version, options) => { + options = parseOptions(options) + + if (version instanceof SemVer) { + return version } -} + if (typeof version !== 'string') { + return null + } -const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; -const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; -const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; -function graphql(request, query, options) { - if (options) { - if (typeof query === "string" && "query" in options) { - return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); - } + if (version.length > MAX_LENGTH) { + return null + } - for (const key in options) { - if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; - return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); - } + const r = options.loose ? re[t.LOOSE] : re[t.FULL] + if (!r.test(version)) { + return null } - const parsedOptions = typeof query === "string" ? Object.assign({ - query - }, options) : query; - const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { - if (NON_VARIABLE_OPTIONS.includes(key)) { - result[key] = parsedOptions[key]; - return result; - } + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} - if (!result.variables) { - result.variables = {}; - } +module.exports = parse - result.variables[key] = parsedOptions[key]; - return result; - }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix - // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 - const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; +/***/ }), - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); - } +/***/ 24636: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return request(requestOptions).then(response => { - if (response.data.errors) { - const headers = {}; +const SemVer = __nccwpck_require__(97414) +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } - throw new GraphqlResponseError(requestOptions, headers, response.data); - } +/***/ }), - return response.data.data; - }); +/***/ 83812: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(81854) +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } +module.exports = prerelease -function withDefaults(request$1, newDefaults) { - const newRequest = request$1.defaults(newDefaults); - const newApi = (query, options) => { - return graphql(newRequest, query, options); - }; +/***/ }), - return Object.assign(newApi, { - defaults: withDefaults.bind(null, newRequest), - endpoint: request.request.endpoint - }); -} +/***/ 42835: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const graphql$1 = withDefaults(request.request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` - }, - method: "POST", - url: "/graphql" -}); -function withCustomRequest(customRequest) { - return withDefaults(customRequest, { - method: "POST", - url: "/graphql" - }); -} +const compare = __nccwpck_require__(86978) +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare -exports.GraphqlResponseError = GraphqlResponseError; -exports.graphql = graphql$1; -exports.withCustomRequest = withCustomRequest; -//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 16723: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compareBuild = __nccwpck_require__(58912) +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort /***/ }), -/***/ 64193: -/***/ ((__unused_webpack_module, exports) => { +/***/ 81417: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const Range = __nccwpck_require__(76639) +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies -Object.defineProperty(exports, "__esModule", ({ value: true })); +/***/ }), -const VERSION = "2.17.0"; +/***/ 32804: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); +const compareBuild = __nccwpck_require__(58912) +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) { - symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - } +/***/ }), - keys.push.apply(keys, symbols); - } +/***/ 95836: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return keys; +const parse = __nccwpck_require__(81854) +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null } +module.exports = valid -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } +/***/ }), - return target; -} +/***/ 71075: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } +// just pre-load all the stuff that index.js lazily exports +const internalRe = __nccwpck_require__(44630) +module.exports = { + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: __nccwpck_require__(10969).SEMVER_SPEC_VERSION, + SemVer: __nccwpck_require__(97414), + compareIdentifiers: __nccwpck_require__(95783).compareIdentifiers, + rcompareIdentifiers: __nccwpck_require__(95783).rcompareIdentifiers, + parse: __nccwpck_require__(81854), + valid: __nccwpck_require__(95836), + clean: __nccwpck_require__(36218), + inc: __nccwpck_require__(99798), + diff: __nccwpck_require__(81246), + major: __nccwpck_require__(61925), + minor: __nccwpck_require__(35519), + patch: __nccwpck_require__(24636), + prerelease: __nccwpck_require__(83812), + compare: __nccwpck_require__(86978), + rcompare: __nccwpck_require__(42835), + compareLoose: __nccwpck_require__(34965), + compareBuild: __nccwpck_require__(58912), + sort: __nccwpck_require__(32804), + rsort: __nccwpck_require__(16723), + gt: __nccwpck_require__(17880), + lt: __nccwpck_require__(11420), + eq: __nccwpck_require__(66535), + neq: __nccwpck_require__(19838), + gte: __nccwpck_require__(70162), + lte: __nccwpck_require__(49299), + cmp: __nccwpck_require__(33455), + coerce: __nccwpck_require__(78851), + Comparator: __nccwpck_require__(3298), + Range: __nccwpck_require__(76639), + satisfies: __nccwpck_require__(81417), + toComparators: __nccwpck_require__(74735), + maxSatisfying: __nccwpck_require__(45967), + minSatisfying: __nccwpck_require__(56081), + minVersion: __nccwpck_require__(84567), + validRange: __nccwpck_require__(42099), + outside: __nccwpck_require__(43860), + gtr: __nccwpck_require__(65251), + ltr: __nccwpck_require__(21789), + intersects: __nccwpck_require__(90133), + simplifyRange: __nccwpck_require__(8422), + subset: __nccwpck_require__(55337), +} + + +/***/ }), + +/***/ 10969: +/***/ ((module) => { - return obj; -} +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' -/** - * Some “list” response that can be paginated have a different response structure - * - * They have a `total_count` key in the response (search also has `incomplete_results`, - * /installation/repositories also has `repository_selection`), as well as a key with - * the list of the items which name varies from endpoint to endpoint. - * - * Octokit normalizes these responses so that paginated results are always returned following - * the same structure. One challenge is that if the list response has only one page, no Link - * header is provided, so this header alone is not sufficient to check wether a response is - * paginated or not. - * - * We check if a "total_count" key is present in the response data, but also make sure that - * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would - * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref - */ -function normalizePaginatedListResponse(response) { - // endpoints can respond with 204 if repository is empty - if (!response.data) { - return _objectSpread2(_objectSpread2({}, response), {}, { - data: [] - }); - } +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 - const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); - if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way - // to retrieve the same information. +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 - const incompleteResults = response.data.incomplete_results; - const repositorySelection = response.data.repository_selection; - const totalCount = response.data.total_count; - delete response.data.incomplete_results; - delete response.data.repository_selection; - delete response.data.total_count; - const namespaceKey = Object.keys(response.data)[0]; - const data = response.data[namespaceKey]; - response.data = data; +module.exports = { + SEMVER_SPEC_VERSION, + MAX_LENGTH, + MAX_SAFE_INTEGER, + MAX_SAFE_COMPONENT_LENGTH +} - if (typeof incompleteResults !== "undefined") { - response.data.incomplete_results = incompleteResults; - } - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; - } +/***/ }), - response.data.total_count = totalCount; - return response; -} +/***/ 51250: +/***/ ((module) => { -function iterator(octokit, route, parameters) { - const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); - const requestMethod = typeof route === "function" ? route : octokit.request; - const method = options.method; - const headers = options.headers; - let url = options.url; - return { - [Symbol.asyncIterator]: () => ({ - async next() { - if (!url) return { - done: true - }; +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} - try { - const response = await requestMethod({ - method, - url, - headers - }); - const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: - // '; rel="next", ; rel="last"' - // sets `url` to undefined if "next" URL is not present or `link` header is not set +module.exports = debug - url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; - return { - value: normalizedResponse - }; - } catch (error) { - if (error.status !== 409) throw error; - url = ""; - return { - value: { - status: 200, - headers: {}, - data: [] - } - }; - } - } - }) - }; -} +/***/ }), -function paginate(octokit, route, parameters, mapFn) { - if (typeof parameters === "function") { - mapFn = parameters; - parameters = undefined; +/***/ 95783: +/***/ ((module) => { + +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b } - return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 } -function gather(octokit, results, iterator, mapFn) { - return iterator.next().then(result => { - if (result.done) { - return results; - } +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) - let earlyExit = false; +module.exports = { + compareIdentifiers, + rcompareIdentifiers +} - function done() { - earlyExit = true; - } - results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); +/***/ }), - if (earlyExit) { - return results; - } +/***/ 29508: +/***/ ((module) => { - return gather(octokit, results, iterator, mapFn); - }); -} +// parse out just the options we care about so we always get a consistent +// obj with keys in a consistent order. +const opts = ['includePrerelease', 'loose', 'rtl'] +const parseOptions = options => + !options ? {} + : typeof options !== 'object' ? { loose: true } + : opts.filter(k => options[k]).reduce((options, k) => { + options[k] = true + return options + }, {}) +module.exports = parseOptions -const composePaginateRest = Object.assign(paginate, { - iterator -}); -const paginatingEndpoints = ["GET /app/hook/deliveries", "GET /app/installations", "GET /applications/grants", "GET /authorizations", "GET /enterprises/{enterprise}/actions/permissions/organizations", "GET /enterprises/{enterprise}/actions/runner-groups", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "GET /enterprises/{enterprise}/actions/runners", "GET /enterprises/{enterprise}/actions/runners/downloads", "GET /events", "GET /gists", "GET /gists/public", "GET /gists/starred", "GET /gists/{gist_id}/comments", "GET /gists/{gist_id}/commits", "GET /gists/{gist_id}/forks", "GET /installation/repositories", "GET /issues", "GET /marketplace_listing/plans", "GET /marketplace_listing/plans/{plan_id}/accounts", "GET /marketplace_listing/stubbed/plans", "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", "GET /networks/{owner}/{repo}/events", "GET /notifications", "GET /organizations", "GET /orgs/{org}/actions/permissions/repositories", "GET /orgs/{org}/actions/runner-groups", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "GET /orgs/{org}/actions/runners", "GET /orgs/{org}/actions/runners/downloads", "GET /orgs/{org}/actions/secrets", "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", "GET /orgs/{org}/blocks", "GET /orgs/{org}/credential-authorizations", "GET /orgs/{org}/events", "GET /orgs/{org}/failed_invitations", "GET /orgs/{org}/hooks", "GET /orgs/{org}/hooks/{hook_id}/deliveries", "GET /orgs/{org}/installations", "GET /orgs/{org}/invitations", "GET /orgs/{org}/invitations/{invitation_id}/teams", "GET /orgs/{org}/issues", "GET /orgs/{org}/members", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/projects", "GET /orgs/{org}/public_members", "GET /orgs/{org}/repos", "GET /orgs/{org}/secret-scanning/alerts", "GET /orgs/{org}/team-sync/groups", "GET /orgs/{org}/teams", "GET /orgs/{org}/teams/{team_slug}/discussions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/invitations", "GET /orgs/{org}/teams/{team_slug}/members", "GET /orgs/{org}/teams/{team_slug}/projects", "GET /orgs/{org}/teams/{team_slug}/repos", "GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings", "GET /orgs/{org}/teams/{team_slug}/teams", "GET /projects/columns/{column_id}/cards", "GET /projects/{project_id}/collaborators", "GET /projects/{project_id}/columns", "GET /repos/{owner}/{repo}/actions/artifacts", "GET /repos/{owner}/{repo}/actions/runners", "GET /repos/{owner}/{repo}/actions/runners/downloads", "GET /repos/{owner}/{repo}/actions/runs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", "GET /repos/{owner}/{repo}/actions/secrets", "GET /repos/{owner}/{repo}/actions/workflows", "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", "GET /repos/{owner}/{repo}/assignees", "GET /repos/{owner}/{repo}/autolinks", "GET /repos/{owner}/{repo}/branches", "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", "GET /repos/{owner}/{repo}/code-scanning/alerts", "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", "GET /repos/{owner}/{repo}/code-scanning/analyses", "GET /repos/{owner}/{repo}/collaborators", "GET /repos/{owner}/{repo}/comments", "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/commits", "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", "GET /repos/{owner}/{repo}/commits/{ref}/statuses", "GET /repos/{owner}/{repo}/contributors", "GET /repos/{owner}/{repo}/deployments", "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "GET /repos/{owner}/{repo}/events", "GET /repos/{owner}/{repo}/forks", "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", "GET /repos/{owner}/{repo}/hooks", "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", "GET /repos/{owner}/{repo}/invitations", "GET /repos/{owner}/{repo}/issues", "GET /repos/{owner}/{repo}/issues/comments", "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/issues/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", "GET /repos/{owner}/{repo}/issues/{issue_number}/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", "GET /repos/{owner}/{repo}/keys", "GET /repos/{owner}/{repo}/labels", "GET /repos/{owner}/{repo}/milestones", "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", "GET /repos/{owner}/{repo}/notifications", "GET /repos/{owner}/{repo}/pages/builds", "GET /repos/{owner}/{repo}/projects", "GET /repos/{owner}/{repo}/pulls", "GET /repos/{owner}/{repo}/pulls/comments", "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", "GET /repos/{owner}/{repo}/releases", "GET /repos/{owner}/{repo}/releases/{release_id}/assets", "GET /repos/{owner}/{repo}/secret-scanning/alerts", "GET /repos/{owner}/{repo}/stargazers", "GET /repos/{owner}/{repo}/subscribers", "GET /repos/{owner}/{repo}/tags", "GET /repos/{owner}/{repo}/teams", "GET /repositories", "GET /repositories/{repository_id}/environments/{environment_name}/secrets", "GET /scim/v2/enterprises/{enterprise}/Groups", "GET /scim/v2/enterprises/{enterprise}/Users", "GET /scim/v2/organizations/{org}/Users", "GET /search/code", "GET /search/commits", "GET /search/issues", "GET /search/labels", "GET /search/repositories", "GET /search/topics", "GET /search/users", "GET /teams/{team_id}/discussions", "GET /teams/{team_id}/discussions/{discussion_number}/comments", "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /teams/{team_id}/discussions/{discussion_number}/reactions", "GET /teams/{team_id}/invitations", "GET /teams/{team_id}/members", "GET /teams/{team_id}/projects", "GET /teams/{team_id}/repos", "GET /teams/{team_id}/team-sync/group-mappings", "GET /teams/{team_id}/teams", "GET /user/blocks", "GET /user/emails", "GET /user/followers", "GET /user/following", "GET /user/gpg_keys", "GET /user/installations", "GET /user/installations/{installation_id}/repositories", "GET /user/issues", "GET /user/keys", "GET /user/marketplace_purchases", "GET /user/marketplace_purchases/stubbed", "GET /user/memberships/orgs", "GET /user/migrations", "GET /user/migrations/{migration_id}/repositories", "GET /user/orgs", "GET /user/packages", "GET /user/public_emails", "GET /user/repos", "GET /user/repository_invitations", "GET /user/starred", "GET /user/subscriptions", "GET /user/teams", "GET /users", "GET /users/{username}/events", "GET /users/{username}/events/orgs/{org}", "GET /users/{username}/events/public", "GET /users/{username}/followers", "GET /users/{username}/following", "GET /users/{username}/gists", "GET /users/{username}/gpg_keys", "GET /users/{username}/keys", "GET /users/{username}/orgs", "GET /users/{username}/packages", "GET /users/{username}/projects", "GET /users/{username}/received_events", "GET /users/{username}/received_events/public", "GET /users/{username}/repos", "GET /users/{username}/starred", "GET /users/{username}/subscriptions"]; +/***/ }), -function isPaginatingEndpoint(arg) { - if (typeof arg === "string") { - return paginatingEndpoints.includes(arg); - } else { - return false; - } -} +/***/ 44630: +/***/ ((module, exports, __nccwpck_require__) => { -/** - * @param octokit Octokit instance - * @param options Options passed to Octokit constructor - */ +const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(10969) +const debug = __nccwpck_require__(51250) +exports = module.exports = {} -function paginateRest(octokit) { - return { - paginate: Object.assign(paginate.bind(null, octokit), { - iterator: iterator.bind(null, octokit) - }) - }; +// The actual regexps go on exports.re +const re = exports.re = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const createToken = (name, value, isGlobal) => { + const index = R++ + debug(index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) } -paginateRest.VERSION = VERSION; -exports.composePaginateRest = composePaginateRest; -exports.isPaginatingEndpoint = isPaginatingEndpoint; -exports.paginateRest = paginateRest; -exports.paginatingEndpoints = paginatingEndpoints; -//# sourceMappingURL=index.js.map +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. -/***/ }), +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') -/***/ 68883: -/***/ ((__unused_webpack_module, exports) => { +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. -"use strict"; +createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') +// ## Main Version +// Three dot-separated numeric identifiers. -Object.defineProperty(exports, "__esModule", ({ value: true })); +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) -const VERSION = "1.0.4"; +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) -/** - * @param octokit Octokit instance - * @param options Options passed to Octokit constructor - */ +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. -function requestLog(octokit) { - octokit.hook.wrap("request", (request, options) => { - octokit.log.debug("request", options); - const start = Date.now(); - const requestOptions = octokit.request.endpoint.parse(options); - const path = requestOptions.url.replace(options.baseUrl, ""); - return request(options).then(response => { - octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`); - return response; - }).catch(error => { - octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`); - throw error; - }); - }); -} -requestLog.VERSION = VERSION; +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) -exports.requestLog = requestLog; -//# sourceMappingURL=index.js.map +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. -/***/ }), +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) -/***/ 83044: -/***/ ((__unused_webpack_module, exports) => { +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) -"use strict"; +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. +createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') -Object.defineProperty(exports, "__esModule", ({ value: true })); +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. -function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. - if (enumerableOnly) { - symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - } +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. - keys.push.apply(keys, symbols); - } +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) - return keys; +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCE', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') + + +/***/ }), + +/***/ 65251: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Determine if version is greater than all the versions possible in the range. +const outside = __nccwpck_require__(43860) +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr + + +/***/ }), + +/***/ 90133: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(76639) +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) } +module.exports = intersects -function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } +/***/ }), + +/***/ 21789: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const outside = __nccwpck_require__(43860) +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr + + +/***/ }), + +/***/ 45967: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(97414) +const Range = __nccwpck_require__(76639) + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying - return target; + +/***/ }), + +/***/ 56081: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(97414) +const Range = __nccwpck_require__(76639) +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min } +module.exports = minSatisfying -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; + +/***/ }), + +/***/ 84567: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(97414) +const Range = __nccwpck_require__(76639) +const gt = __nccwpck_require__(17880) + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver } - return obj; -} + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } -const Endpoints = { - actions: { - addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - approveWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"], - cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], - createOrUpdateEnvironmentSecret: ["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], - createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], - createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], - createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], - createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], - createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], - createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], - deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - deleteEnvironmentSecret: ["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], - deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], - deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], - deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], - deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], - deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], - disableSelectedRepositoryGithubActionsOrganization: ["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"], - disableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"], - downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], - downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], - downloadWorkflowRunAttemptLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"], - downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], - enableSelectedRepositoryGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"], - enableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"], - getAllowedActionsOrganization: ["GET /orgs/{org}/actions/permissions/selected-actions"], - getAllowedActionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"], - getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], - getEnvironmentPublicKey: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"], - getEnvironmentSecret: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], - getGithubActionsPermissionsOrganization: ["GET /orgs/{org}/actions/permissions"], - getGithubActionsPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions"], - getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], - getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], - getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], - getPendingDeploymentsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], - getRepoPermissions: ["GET /repos/{owner}/{repo}/actions/permissions", {}, { - renamed: ["actions", "getGithubActionsPermissionsRepository"] - }], - getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], - getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], - getReviewsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"], - getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], - getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], - getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], - getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], - getWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"], - getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], - getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], - listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], - listEnvironmentSecrets: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets"], - listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], - listJobsForWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"], - listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], - listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], - listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], - listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], - listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], - listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], - listSelectedRepositoriesEnabledGithubActionsOrganization: ["GET /orgs/{org}/actions/permissions/repositories"], - listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], - listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], - listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], - listWorkflowRuns: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"], - listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], - removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], - reviewPendingDeploymentsForRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], - setAllowedActionsOrganization: ["PUT /orgs/{org}/actions/permissions/selected-actions"], - setAllowedActionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"], - setGithubActionsPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions"], - setGithubActionsPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions"], - setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"], - setSelectedRepositoriesEnabledGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories"] - }, - activity: { - checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], - deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], - deleteThreadSubscription: ["DELETE /notifications/threads/{thread_id}/subscription"], - getFeeds: ["GET /feeds"], - getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], - getThread: ["GET /notifications/threads/{thread_id}"], - getThreadSubscriptionForAuthenticatedUser: ["GET /notifications/threads/{thread_id}/subscription"], - listEventsForAuthenticatedUser: ["GET /users/{username}/events"], - listNotificationsForAuthenticatedUser: ["GET /notifications"], - listOrgEventsForAuthenticatedUser: ["GET /users/{username}/events/orgs/{org}"], - listPublicEvents: ["GET /events"], - listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], - listPublicEventsForUser: ["GET /users/{username}/events/public"], - listPublicOrgEvents: ["GET /orgs/{org}/events"], - listReceivedEventsForUser: ["GET /users/{username}/received_events"], - listReceivedPublicEventsForUser: ["GET /users/{username}/received_events/public"], - listRepoEvents: ["GET /repos/{owner}/{repo}/events"], - listRepoNotificationsForAuthenticatedUser: ["GET /repos/{owner}/{repo}/notifications"], - listReposStarredByAuthenticatedUser: ["GET /user/starred"], - listReposStarredByUser: ["GET /users/{username}/starred"], - listReposWatchedByUser: ["GET /users/{username}/subscriptions"], - listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], - listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], - listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], - markNotificationsAsRead: ["PUT /notifications"], - markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], - markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], - setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], - setThreadSubscription: ["PUT /notifications/threads/{thread_id}/subscription"], - starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], - unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] - }, - apps: { - addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, { - renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] - }], - addRepoToInstallationForAuthenticatedUser: ["PUT /user/installations/{installation_id}/repositories/{repository_id}"], - checkToken: ["POST /applications/{client_id}/token"], - createContentAttachment: ["POST /content_references/{content_reference_id}/attachments", { - mediaType: { - previews: ["corsair"] + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) } - }], - createContentAttachmentForRepo: ["POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", { - mediaType: { - previews: ["corsair"] + }) + if (setMin && (!minver || gt(minver, setMin))) + minver = setMin + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion + + +/***/ }), + +/***/ 43860: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(97414) +const Comparator = __nccwpck_require__(3298) +const {ANY} = Comparator +const Range = __nccwpck_require__(76639) +const satisfies = __nccwpck_require__(81417) +const gt = __nccwpck_require__(17880) +const lt = __nccwpck_require__(11420) +const lte = __nccwpck_require__(49299) +const gte = __nccwpck_require__(70162) + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') } - }], - createFromManifest: ["POST /app-manifests/{code}/conversions"], - createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], - deleteAuthorization: ["DELETE /applications/{client_id}/grant"], - deleteInstallation: ["DELETE /app/installations/{installation_id}"], - deleteToken: ["DELETE /applications/{client_id}/token"], - getAuthenticated: ["GET /app"], - getBySlug: ["GET /apps/{app_slug}"], - getInstallation: ["GET /app/installations/{installation_id}"], - getOrgInstallation: ["GET /orgs/{org}/installation"], - getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], - getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], - getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], - getUserInstallation: ["GET /users/{username}/installation"], - getWebhookConfigForApp: ["GET /app/hook/config"], - getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], - listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], - listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], - listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories"], - listInstallations: ["GET /app/installations"], - listInstallationsForAuthenticatedUser: ["GET /user/installations"], - listPlans: ["GET /marketplace_listing/plans"], - listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], - listReposAccessibleToInstallation: ["GET /installation/repositories"], - listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], - listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], - listWebhookDeliveries: ["GET /app/hook/deliveries"], - redeliverWebhookDelivery: ["POST /app/hook/deliveries/{delivery_id}/attempts"], - removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}", {}, { - renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] - }], - removeRepoFromInstallationForAuthenticatedUser: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], - resetToken: ["PATCH /applications/{client_id}/token"], - revokeInstallationAccessToken: ["DELETE /installation/token"], - scopeToken: ["POST /applications/{client_id}/token/scoped"], - suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], - unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"], - updateWebhookConfigForApp: ["PATCH /app/hook/config"] - }, - billing: { - getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], - getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], - getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], - getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], - getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], - getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] - }, - checks: { - create: ["POST /repos/{owner}/{repo}/check-runs"], - createSuite: ["POST /repos/{owner}/{repo}/check-suites"], - get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], - getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], - listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"], - listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], - listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"], - listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], - rerequestRun: ["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"], - rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"], - setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences"], - update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] - }, - codeScanning: { - deleteAnalysis: ["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"], - getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { - renamedParameters: { - alert_id: "alert_number" + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator } - }], - getAnalysis: ["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"], - getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], - listAlertInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], - listAlertsInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { - renamed: ["codeScanning", "listAlertInstances"] - }], - listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], - updateAlert: ["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"], - uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] - }, - codesOfConduct: { - getAllCodesOfConduct: ["GET /codes_of_conduct"], - getConductCode: ["GET /codes_of_conduct/{key}"] - }, - emojis: { - get: ["GET /emojis"] - }, - enterpriseAdmin: { - disableSelectedOrganizationGithubActionsEnterprise: ["DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], - enableSelectedOrganizationGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], - getAllowedActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/selected-actions"], - getGithubActionsPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions"], - listSelectedOrganizationsEnabledGithubActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/organizations"], - setAllowedActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"], - setGithubActionsPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions"], - setSelectedOrganizationsEnabledGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations"] - }, - gists: { - checkIsStarred: ["GET /gists/{gist_id}/star"], - create: ["POST /gists"], - createComment: ["POST /gists/{gist_id}/comments"], - delete: ["DELETE /gists/{gist_id}"], - deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], - fork: ["POST /gists/{gist_id}/forks"], - get: ["GET /gists/{gist_id}"], - getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], - getRevision: ["GET /gists/{gist_id}/{sha}"], - list: ["GET /gists"], - listComments: ["GET /gists/{gist_id}/comments"], - listCommits: ["GET /gists/{gist_id}/commits"], - listForUser: ["GET /users/{username}/gists"], - listForks: ["GET /gists/{gist_id}/forks"], - listPublic: ["GET /gists/public"], - listStarred: ["GET /gists/starred"], - star: ["PUT /gists/{gist_id}/star"], - unstar: ["DELETE /gists/{gist_id}/star"], - update: ["PATCH /gists/{gist_id}"], - updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] - }, - git: { - createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], - createCommit: ["POST /repos/{owner}/{repo}/git/commits"], - createRef: ["POST /repos/{owner}/{repo}/git/refs"], - createTag: ["POST /repos/{owner}/{repo}/git/tags"], - createTree: ["POST /repos/{owner}/{repo}/git/trees"], - deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], - getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], - getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], - getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], - getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], - getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], - listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], - updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] - }, - gitignore: { - getAllTemplates: ["GET /gitignore/templates"], - getTemplate: ["GET /gitignore/templates/{name}"] - }, - interactions: { - getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], - getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], - getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], - getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits", {}, { - renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] - }], - removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], - removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], - removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits"], - removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits", {}, { - renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] - }], - setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], - setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], - setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], - setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits", {}, { - renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] - }] - }, - issues: { - addAssignees: ["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"], - addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], - checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], - create: ["POST /repos/{owner}/{repo}/issues"], - createComment: ["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"], - createLabel: ["POST /repos/{owner}/{repo}/labels"], - createMilestone: ["POST /repos/{owner}/{repo}/milestones"], - deleteComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"], - deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], - deleteMilestone: ["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"], - get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], - getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], - getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], - getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], - getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], - list: ["GET /issues"], - listAssignees: ["GET /repos/{owner}/{repo}/assignees"], - listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], - listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], - listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], - listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], - listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"], - listForAuthenticatedUser: ["GET /user/issues"], - listForOrg: ["GET /orgs/{org}/issues"], - listForRepo: ["GET /repos/{owner}/{repo}/issues"], - listLabelsForMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"], - listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], - listLabelsOnIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"], - listMilestones: ["GET /repos/{owner}/{repo}/milestones"], - lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], - removeAllLabels: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"], - removeAssignees: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"], - removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], - setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], - unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], - update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], - updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], - updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], - updateMilestone: ["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"] - }, - licenses: { - get: ["GET /licenses/{license}"], - getAllCommonlyUsed: ["GET /licenses"], - getForRepo: ["GET /repos/{owner}/{repo}/license"] - }, - markdown: { - render: ["POST /markdown"], - renderRaw: ["POST /markdown/raw", { - headers: { - "content-type": "text/plain; charset=utf-8" + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside + + +/***/ }), + +/***/ 8422: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = __nccwpck_require__(81417) +const compare = __nccwpck_require__(86978) +module.exports = (versions, range, options) => { + const set = [] + let min = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!min) + min = version + } else { + if (prev) { + set.push([min, prev]) } - }] - }, - meta: { - get: ["GET /meta"], - getOctocat: ["GET /octocat"], - getZen: ["GET /zen"], - root: ["GET /"] - }, - migrations: { - cancelImport: ["DELETE /repos/{owner}/{repo}/import"], - deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive"], - deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive"], - downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive"], - getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive"], - getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], - getImportStatus: ["GET /repos/{owner}/{repo}/import"], - getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], - getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], - getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], - listForAuthenticatedUser: ["GET /user/migrations"], - listForOrg: ["GET /orgs/{org}/migrations"], - listReposForAuthenticatedUser: ["GET /user/migrations/{migration_id}/repositories"], - listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], - listReposForUser: ["GET /user/migrations/{migration_id}/repositories", {}, { - renamed: ["migrations", "listReposForAuthenticatedUser"] - }], - mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], - setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], - startForAuthenticatedUser: ["POST /user/migrations"], - startForOrg: ["POST /orgs/{org}/migrations"], - startImport: ["PUT /repos/{owner}/{repo}/import"], - unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"], - unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"], - updateImport: ["PATCH /repos/{owner}/{repo}/import"] - }, - orgs: { - blockUser: ["PUT /orgs/{org}/blocks/{username}"], - cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], - checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], - checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], - checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], - convertMemberToOutsideCollaborator: ["PUT /orgs/{org}/outside_collaborators/{username}"], - createInvitation: ["POST /orgs/{org}/invitations"], - createWebhook: ["POST /orgs/{org}/hooks"], - deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], - get: ["GET /orgs/{org}"], - getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], - getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], - getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], - getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], - getWebhookDelivery: ["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"], - list: ["GET /organizations"], - listAppInstallations: ["GET /orgs/{org}/installations"], - listBlockedUsers: ["GET /orgs/{org}/blocks"], - listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], - listForAuthenticatedUser: ["GET /user/orgs"], - listForUser: ["GET /users/{username}/orgs"], - listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], - listMembers: ["GET /orgs/{org}/members"], - listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], - listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], - listPendingInvitations: ["GET /orgs/{org}/invitations"], - listPublicMembers: ["GET /orgs/{org}/public_members"], - listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], - listWebhooks: ["GET /orgs/{org}/hooks"], - pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: ["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], - removeMember: ["DELETE /orgs/{org}/members/{username}"], - removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], - removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], - removePublicMembershipForAuthenticatedUser: ["DELETE /orgs/{org}/public_members/{username}"], - setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], - setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], - unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], - update: ["PATCH /orgs/{org}"], - updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], - updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], - updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] - }, - packages: { - deletePackageForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}"], - deletePackageForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}"], - deletePackageForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}"], - deletePackageVersionForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], - deletePackageVersionForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - deletePackageVersionForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getAllPackageVersionsForAPackageOwnedByAnOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { - renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] - }], - getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions", {}, { - renamed: ["packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"] - }], - getAllPackageVersionsForPackageOwnedByAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions"], - getAllPackageVersionsForPackageOwnedByOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"], - getAllPackageVersionsForPackageOwnedByUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions"], - getPackageForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}"], - getPackageForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}"], - getPackageForUser: ["GET /users/{username}/packages/{package_type}/{package_name}"], - getPackageVersionForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getPackageVersionForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - getPackageVersionForUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], - listPackagesForAuthenticatedUser: ["GET /user/packages"], - listPackagesForOrganization: ["GET /orgs/{org}/packages"], - listPackagesForUser: ["GET /users/{username}/packages"], - restorePackageForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"], - restorePackageVersionForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], - restorePackageVersionForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], - restorePackageVersionForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"] - }, - projects: { - addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], - createCard: ["POST /projects/columns/{column_id}/cards"], - createColumn: ["POST /projects/{project_id}/columns"], - createForAuthenticatedUser: ["POST /user/projects"], - createForOrg: ["POST /orgs/{org}/projects"], - createForRepo: ["POST /repos/{owner}/{repo}/projects"], - delete: ["DELETE /projects/{project_id}"], - deleteCard: ["DELETE /projects/columns/cards/{card_id}"], - deleteColumn: ["DELETE /projects/columns/{column_id}"], - get: ["GET /projects/{project_id}"], - getCard: ["GET /projects/columns/cards/{card_id}"], - getColumn: ["GET /projects/columns/{column_id}"], - getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission"], - listCards: ["GET /projects/columns/{column_id}/cards"], - listCollaborators: ["GET /projects/{project_id}/collaborators"], - listColumns: ["GET /projects/{project_id}/columns"], - listForOrg: ["GET /orgs/{org}/projects"], - listForRepo: ["GET /repos/{owner}/{repo}/projects"], - listForUser: ["GET /users/{username}/projects"], - moveCard: ["POST /projects/columns/cards/{card_id}/moves"], - moveColumn: ["POST /projects/columns/{column_id}/moves"], - removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}"], - update: ["PATCH /projects/{project_id}"], - updateCard: ["PATCH /projects/columns/cards/{card_id}"], - updateColumn: ["PATCH /projects/columns/{column_id}"] - }, - pulls: { - checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - create: ["POST /repos/{owner}/{repo}/pulls"], - createReplyForReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"], - createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - createReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"], - deletePendingReview: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - deleteReviewComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - dismissReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"], - get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], - getReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], - list: ["GET /repos/{owner}/{repo}/pulls"], - listCommentsForReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"], - listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], - listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], - listRequestedReviewers: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - listReviewComments: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"], - listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], - listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], - merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], - removeRequestedReviewers: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - requestReviewers: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], - submitReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"], - update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], - updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"], - updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], - updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] - }, - rateLimit: { - get: ["GET /rate_limit"] - }, - reactions: { - createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"], - createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], - createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], - createForRelease: ["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"], - createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], - createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"], - deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"], - deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"], - deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"], - deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"], - deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"], - deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"], - listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"], - listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], - listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], - listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], - listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], - listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"] - }, - repos: { - acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}", {}, { - renamed: ["repos", "acceptInvitationForAuthenticatedUser"] - }], - acceptInvitationForAuthenticatedUser: ["PATCH /user/repository_invitations/{invitation_id}"], - addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], - addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], - addStatusCheckContexts: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { - mapToData: "contexts" - }], - addTeamAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { - mapToData: "teams" - }], - addUserAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { - mapToData: "users" - }], - checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], - checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts"], - compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], - compareCommitsWithBasehead: ["GET /repos/{owner}/{repo}/compare/{basehead}"], - createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], - createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], - createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], - createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], - createDeployKey: ["POST /repos/{owner}/{repo}/keys"], - createDeployment: ["POST /repos/{owner}/{repo}/deployments"], - createDeploymentStatus: ["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], - createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], - createForAuthenticatedUser: ["POST /user/repos"], - createFork: ["POST /repos/{owner}/{repo}/forks"], - createInOrg: ["POST /orgs/{org}/repos"], - createOrUpdateEnvironment: ["PUT /repos/{owner}/{repo}/environments/{environment_name}"], - createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], - createPagesSite: ["POST /repos/{owner}/{repo}/pages"], - createRelease: ["POST /repos/{owner}/{repo}/releases"], - createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate"], - createWebhook: ["POST /repos/{owner}/{repo}/hooks"], - declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}", {}, { - renamed: ["repos", "declineInvitationForAuthenticatedUser"] - }], - declineInvitationForAuthenticatedUser: ["DELETE /user/repository_invitations/{invitation_id}"], - delete: ["DELETE /repos/{owner}/{repo}"], - deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], - deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - deleteAnEnvironment: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}"], - deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], - deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], - deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], - deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], - deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], - deleteDeployment: ["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"], - deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], - deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], - deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], - deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], - deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], - deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], - deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], - disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes"], - disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"], - disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts"], - downloadArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}", {}, { - renamed: ["repos", "downloadZipballArchive"] - }], - downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], - downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], - enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes"], - enableLfsForRepo: ["PUT /repos/{owner}/{repo}/lfs"], - enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts"], - generateReleaseNotes: ["POST /repos/{owner}/{repo}/releases/generate-notes"], - get: ["GET /repos/{owner}/{repo}"], - getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], - getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], - getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], - getAllTopics: ["GET /repos/{owner}/{repo}/topics", { - mediaType: { - previews: ["mercy"] - } - }], - getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], - getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], - getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], - getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], - getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], - getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], - getCollaboratorPermissionLevel: ["GET /repos/{owner}/{repo}/collaborators/{username}/permission"], - getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], - getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], - getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], - getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], - getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], - getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], - getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], - getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], - getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], - getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], - getDeploymentStatus: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"], - getEnvironment: ["GET /repos/{owner}/{repo}/environments/{environment_name}"], - getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], - getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], - getPages: ["GET /repos/{owner}/{repo}/pages"], - getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], - getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], - getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], - getPullRequestReviewProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], - getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], - getReadme: ["GET /repos/{owner}/{repo}/readme"], - getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], - getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], - getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], - getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], - getStatusChecksProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], - getTeamsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"], - getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], - getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], - getUsersWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"], - getViews: ["GET /repos/{owner}/{repo}/traffic/views"], - getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], - getWebhookConfigForRepo: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"], - getWebhookDelivery: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"], - listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], - listBranches: ["GET /repos/{owner}/{repo}/branches"], - listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"], - listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], - listCommentsForCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"], - listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], - listCommitStatusesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/statuses"], - listCommits: ["GET /repos/{owner}/{repo}/commits"], - listContributors: ["GET /repos/{owner}/{repo}/contributors"], - listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], - listDeploymentStatuses: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], - listDeployments: ["GET /repos/{owner}/{repo}/deployments"], - listForAuthenticatedUser: ["GET /user/repos"], - listForOrg: ["GET /orgs/{org}/repos"], - listForUser: ["GET /users/{username}/repos"], - listForks: ["GET /repos/{owner}/{repo}/forks"], - listInvitations: ["GET /repos/{owner}/{repo}/invitations"], - listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], - listLanguages: ["GET /repos/{owner}/{repo}/languages"], - listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], - listPublic: ["GET /repositories"], - listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"], - listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], - listReleases: ["GET /repos/{owner}/{repo}/releases"], - listTags: ["GET /repos/{owner}/{repo}/tags"], - listTeams: ["GET /repos/{owner}/{repo}/teams"], - listWebhookDeliveries: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"], - listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], - merge: ["POST /repos/{owner}/{repo}/merges"], - mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], - pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], - redeliverWebhookDelivery: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], - removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], - removeCollaborator: ["DELETE /repos/{owner}/{repo}/collaborators/{username}"], - removeStatusCheckContexts: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { - mapToData: "contexts" - }], - removeStatusCheckProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], - removeTeamAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { - mapToData: "teams" - }], - removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { - mapToData: "users" - }], - renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], - replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics", { - mediaType: { - previews: ["mercy"] - } - }], - requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], - setAdminBranchProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], - setAppAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { - mapToData: "apps" - }], - setStatusCheckContexts: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { - mapToData: "contexts" - }], - setTeamAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { - mapToData: "teams" - }], - setUserAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { - mapToData: "users" - }], - testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], - transfer: ["POST /repos/{owner}/{repo}/transfer"], - update: ["PATCH /repos/{owner}/{repo}"], - updateBranchProtection: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection"], - updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], - updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], - updateInvitation: ["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"], - updatePullRequestReviewProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], - updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], - updateReleaseAsset: ["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"], - updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", {}, { - renamed: ["repos", "updateStatusCheckProtection"] - }], - updateStatusCheckProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], - updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], - updateWebhookConfigForRepo: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"], - uploadReleaseAsset: ["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { - baseUrl: "https://uploads.github.com" - }] - }, - search: { - code: ["GET /search/code"], - commits: ["GET /search/commits"], - issuesAndPullRequests: ["GET /search/issues"], - labels: ["GET /search/labels"], - repos: ["GET /search/repositories"], - topics: ["GET /search/topics", { - mediaType: { - previews: ["mercy"] - } - }], - users: ["GET /search/users"] - }, - secretScanning: { - getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], - listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], - listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], - updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"] - }, - teams: { - addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], - addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"], - addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], - checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"], - checkPermissionsForRepoInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], - create: ["POST /orgs/{org}/teams"], - createDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], - createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], - deleteDiscussionCommentInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], - deleteDiscussionInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], - deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], - getByName: ["GET /orgs/{org}/teams/{team_slug}"], - getDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], - getDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], - getMembershipForUserInOrg: ["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"], - list: ["GET /orgs/{org}/teams"], - listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], - listDiscussionCommentsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], - listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], - listForAuthenticatedUser: ["GET /user/teams"], - listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], - listPendingInvitationsInOrg: ["GET /orgs/{org}/teams/{team_slug}/invitations"], - listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], - listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], - removeMembershipForUserInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"], - removeProjectInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"], - removeRepoInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], - updateDiscussionCommentInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], - updateDiscussionInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], - updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] - }, - users: { - addEmailForAuthenticated: ["POST /user/emails", {}, { - renamed: ["users", "addEmailForAuthenticatedUser"] - }], - addEmailForAuthenticatedUser: ["POST /user/emails"], - block: ["PUT /user/blocks/{username}"], - checkBlocked: ["GET /user/blocks/{username}"], - checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], - checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], - createGpgKeyForAuthenticated: ["POST /user/gpg_keys", {}, { - renamed: ["users", "createGpgKeyForAuthenticatedUser"] - }], - createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], - createPublicSshKeyForAuthenticated: ["POST /user/keys", {}, { - renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] - }], - createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], - deleteEmailForAuthenticated: ["DELETE /user/emails", {}, { - renamed: ["users", "deleteEmailForAuthenticatedUser"] - }], - deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], - deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}", {}, { - renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] - }], - deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], - deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}", {}, { - renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] - }], - deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], - follow: ["PUT /user/following/{username}"], - getAuthenticated: ["GET /user"], - getByUsername: ["GET /users/{username}"], - getContextForUser: ["GET /users/{username}/hovercard"], - getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}", {}, { - renamed: ["users", "getGpgKeyForAuthenticatedUser"] - }], - getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], - getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}", {}, { - renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] - }], - getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], - list: ["GET /users"], - listBlockedByAuthenticated: ["GET /user/blocks", {}, { - renamed: ["users", "listBlockedByAuthenticatedUser"] - }], - listBlockedByAuthenticatedUser: ["GET /user/blocks"], - listEmailsForAuthenticated: ["GET /user/emails", {}, { - renamed: ["users", "listEmailsForAuthenticatedUser"] - }], - listEmailsForAuthenticatedUser: ["GET /user/emails"], - listFollowedByAuthenticated: ["GET /user/following", {}, { - renamed: ["users", "listFollowedByAuthenticatedUser"] - }], - listFollowedByAuthenticatedUser: ["GET /user/following"], - listFollowersForAuthenticatedUser: ["GET /user/followers"], - listFollowersForUser: ["GET /users/{username}/followers"], - listFollowingForUser: ["GET /users/{username}/following"], - listGpgKeysForAuthenticated: ["GET /user/gpg_keys", {}, { - renamed: ["users", "listGpgKeysForAuthenticatedUser"] - }], - listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], - listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], - listPublicEmailsForAuthenticated: ["GET /user/public_emails", {}, { - renamed: ["users", "listPublicEmailsForAuthenticatedUser"] - }], - listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], - listPublicKeysForUser: ["GET /users/{username}/keys"], - listPublicSshKeysForAuthenticated: ["GET /user/keys", {}, { - renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] - }], - listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], - setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility", {}, { - renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] - }], - setPrimaryEmailVisibilityForAuthenticatedUser: ["PATCH /user/email/visibility"], - unblock: ["DELETE /user/blocks/{username}"], - unfollow: ["DELETE /user/following/{username}"], - updateAuthenticated: ["PATCH /user"] + prev = null + min = null + } } -}; + if (min) + set.push([min, null]) -const VERSION = "5.13.0"; + const ranges = [] + for (const [min, max] of set) { + if (min === max) + ranges.push(min) + else if (!max && min === v[0]) + ranges.push('*') + else if (!max) + ranges.push(`>=${min}`) + else if (min === v[0]) + ranges.push(`<=${max}`) + else + ranges.push(`${min} - ${max}`) + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} -function endpointsToMethods(octokit, endpointsMap) { - const newMethods = {}; - for (const [scope, endpoints] of Object.entries(endpointsMap)) { - for (const [methodName, endpoint] of Object.entries(endpoints)) { - const [route, defaults, decorations] = endpoint; - const [method, url] = route.split(/ /); - const endpointDefaults = Object.assign({ - method, - url - }, defaults); +/***/ }), - if (!newMethods[scope]) { - newMethods[scope] = {}; - } +/***/ 55337: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const scopeMethods = newMethods[scope]; +const Range = __nccwpck_require__(76639) +const Comparator = __nccwpck_require__(3298) +const { ANY } = Comparator +const satisfies = __nccwpck_require__(81417) +const compare = __nccwpck_require__(86978) - if (decorations) { - scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); - continue; - } +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true - scopeMethods[methodName] = octokit.request.defaults(endpointDefaults); +const subset = (sub, dom, options = {}) => { + if (sub === dom) + return true + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) + continue OUTER } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) + return false } - - return newMethods; + return true } -function decorate(octokit, scope, methodName, defaults, decorations) { - const requestWithDefaults = octokit.request.defaults(defaults); - /* istanbul ignore next */ +const simpleSubset = (sub, dom, options) => { + if (sub === dom) + return true - function withDecorations(...args) { - // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 - let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData` + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) + return true + else if (options.includePrerelease) + sub = [ new Comparator('>=0.0.0-0') ] + else + sub = [ new Comparator('>=0.0.0') ] + } - if (decorations.mapToData) { - options = Object.assign({}, options, { - data: options[decorations.mapToData], - [decorations.mapToData]: undefined - }); - return requestWithDefaults(options); - } + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) + return true + else + dom = [ new Comparator('>=0.0.0') ] + } - if (decorations.renamed) { - const [newScope, newMethodName] = decorations.renamed; - octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`); - } + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') + gt = higherGT(gt, c, options) + else if (c.operator === '<' || c.operator === '<=') + lt = lowerLT(lt, c, options) + else + eqSet.add(c.semver) + } - if (decorations.deprecated) { - octokit.log.warn(decorations.deprecated); - } + if (eqSet.size > 1) + return null - if (decorations.renamedParameters) { - // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 - const options = requestWithDefaults.endpoint.merge(...args); + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) + return null + else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) + return null + } - for (const [name, alias] of Object.entries(decorations.renamedParameters)) { - if (name in options) { - octokit.log.warn(`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`); + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) + return null - if (!(alias in options)) { - options[alias] = options[name]; - } + if (lt && !satisfies(eq, String(lt), options)) + return null - delete options[name]; + for (const c of dom) { + if (!satisfies(eq, String(c), options)) + return false + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) + return false + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) + return false + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false } } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) + return false + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) + return false + } + if (!c.operator && (lt || gt) && gtltComp !== 0) + return false + } - return requestWithDefaults(options); - } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) + return false + if (lt && hasDomGT && !gt && gtltComp !== 0) + return false - return requestWithDefaults(...args); - } + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) + return false - return Object.assign(withDecorations, requestWithDefaults); + return true } -function restEndpointMethods(octokit) { - const api = endpointsToMethods(octokit, Endpoints); - return { - rest: api - }; +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) + return b + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a } -restEndpointMethods.VERSION = VERSION; -function legacyRestEndpointMethods(octokit) { - const api = endpointsToMethods(octokit, Endpoints); - return _objectSpread2(_objectSpread2({}, api), {}, { - rest: api - }); + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) + return b + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a } -legacyRestEndpointMethods.VERSION = VERSION; -exports.legacyRestEndpointMethods = legacyRestEndpointMethods; -exports.restEndpointMethods = restEndpointMethods; -//# sourceMappingURL=index.js.map +module.exports = subset /***/ }), -/***/ 10537: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 74735: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const Range = __nccwpck_require__(76639) +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) -Object.defineProperty(exports, "__esModule", ({ value: true })); +module.exports = toComparators -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var deprecation = __nccwpck_require__(58932); -var once = _interopDefault(__nccwpck_require__(1223)); +/***/ }), -const logOnceCode = once(deprecation => console.warn(deprecation)); -const logOnceHeaders = once(deprecation => console.warn(deprecation)); -/** - * Error with extra properties to help with debugging - */ +/***/ 42099: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -class RequestError extends Error { - constructor(message, statusCode, options) { - super(message); // Maintains proper stack trace (only available on V8) +const Range = __nccwpck_require__(76639) +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange - /* istanbul ignore next */ - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } +/***/ }), - this.name = "HttpError"; - this.status = statusCode; - let headers; +/***/ 48628: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if ("headers" in options && typeof options.headers !== "undefined") { - headers = options.headers; - } +"use strict"; - if ("response" in options) { - this.response = options.response; - headers = options.response.headers; - } // redact request credentials without mutating original request options +const npa = __nccwpck_require__(32695); +const path = __nccwpck_require__(85622); +const loadJsonFile = __nccwpck_require__(75978); +const writePkg = __nccwpck_require__(16440); - const requestCopy = Object.assign({}, options.request); +// symbol used to "hide" internal state +const PKG = Symbol("pkg"); - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") - }); - } +/* eslint-disable no-underscore-dangle */ - requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit - // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications - .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended - // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header - .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; // deprecations +// private fields +const _location = Symbol("location"); +const _resolved = Symbol("resolved"); +const _rootPath = Symbol("rootPath"); +const _scripts = Symbol("scripts"); +const _contents = Symbol("contents"); - Object.defineProperty(this, "code", { - get() { - logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - } +/** + * @param {import("npm-package-arg").Result} result + */ +function binSafeName({ name, scope }) { + return scope ? name.substring(scope.length + 1) : name; +} - }); - Object.defineProperty(this, "headers", { - get() { - logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); - return headers || {}; - } +// package.json files are not that complicated, so this is intentionally naïve +function shallowCopy(json) { + return Object.keys(json).reduce((obj, key) => { + const val = json[key]; - }); - } + /* istanbul ignore if */ + if (Array.isArray(val)) { + obj[key] = val.slice(); + } else if (val && typeof val === "object") { + obj[key] = Object.assign({}, val); + } else { + obj[key] = val; + } + return obj; + }, {}); } -exports.RequestError = RequestError; -//# sourceMappingURL=index.js.map - +/** + * @typedef {object} RawManifest The subset of package.json properties that Lerna uses + * @property {string} name + * @property {string} version + * @property {boolean} [private] + * @property {Record|string} [bin] + * @property {Record} [scripts] + * @property {Record} [dependencies] + * @property {Record} [devDependencies] + * @property {Record} [optionalDependencies] + * @property {Record} [peerDependencies] + * @property {Record<'directory' | 'registry' | 'tag', string>} [publishConfig] + * @property {string[] | { packages: string[] }} [workspaces] + */ -/***/ }), +/** + * Lerna's internal representation of a local package, with + * many values resolved directly from the original JSON. + */ +class Package { + /** + * Create a Package instance from parameters, possibly reusing existing instance. + * @param {string|Package|RawManifest} ref A path to a package.json file, Package instance, or JSON object + * @param {string} [dir] If `ref` is a JSON object, this is the location of the manifest + * @returns {Package} + */ + static lazy(ref, dir = ".") { + if (typeof ref === "string") { + const location = path.resolve(path.basename(ref) === "package.json" ? path.dirname(ref) : ref); + const manifest = loadJsonFile.sync(path.join(location, "package.json")); -/***/ 36234: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return new Package(manifest, location); + } -"use strict"; + // don't use instanceof because it fails across nested module boundaries + if ("__isLernaPackage" in ref) { + return ref; + } + // assume ref is a json object + return new Package(ref, dir); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + /** + * @param {RawManifest} pkg + * @param {string} location + * @param {string} [rootPath] + */ + constructor(pkg, location, rootPath = location) { + // npa will throw an error if the name is invalid + const resolved = npa.resolve(pkg.name, `file:${path.relative(rootPath, location)}`, rootPath); -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + this.name = pkg.name; + this[PKG] = pkg; -var endpoint = __nccwpck_require__(59440); -var universalUserAgent = __nccwpck_require__(45030); -var isPlainObject = __nccwpck_require__(63287); -var nodeFetch = _interopDefault(__nccwpck_require__(80467)); -var requestError = __nccwpck_require__(10537); + // omit raw pkg from default util.inspect() output, but preserve internal mutability + Object.defineProperty(this, PKG, { enumerable: false, writable: true }); -const VERSION = "5.6.2"; + this[_location] = location; + this[_resolved] = resolved; + this[_rootPath] = rootPath; + this[_scripts] = { ...pkg.scripts }; + } -function getBufferResponse(response) { - return response.arrayBuffer(); -} + // readonly getters + get location() { + return this[_location]; + } -function fetchWrapper(requestOptions) { - const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + get private() { + return Boolean(this[PKG].private); + } - if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); + get resolved() { + return this[_resolved]; } - let headers = {}; - let status; - let url; - const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; - return fetch(requestOptions.url, Object.assign({ - method: requestOptions.method, - body: requestOptions.body, - headers: requestOptions.headers, - redirect: requestOptions.redirect - }, // `requestOptions.request.agent` type is incompatible - // see https://github.com/octokit/types.ts/pull/264 - requestOptions.request)).then(async response => { - url = response.url; - status = response.status; + get rootPath() { + return this[_rootPath]; + } - for (const keyAndValue of response.headers) { - headers[keyAndValue[0]] = keyAndValue[1]; - } + get scripts() { + return this[_scripts]; + } - if ("deprecation" in headers) { - const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); - const deprecationLink = matches && matches.pop(); - log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); - } + get bin() { + const pkg = this[PKG]; + return typeof pkg.bin === "string" + ? { + [binSafeName(this.resolved)]: pkg.bin, + } + : Object.assign({}, pkg.bin); + } - if (status === 204 || status === 205) { - return; - } // GitHub API returns 200 for HEAD requests + get binLocation() { + return path.join(this.location, "node_modules", ".bin"); + } + get manifestLocation() { + return path.join(this.location, "package.json"); + } - if (requestOptions.method === "HEAD") { - if (status < 400) { - return; - } + get nodeModulesLocation() { + return path.join(this.location, "node_modules"); + } - throw new requestError.RequestError(response.statusText, status, { - response: { - url, - status, - headers, - data: undefined - }, - request: requestOptions - }); - } + // eslint-disable-next-line class-methods-use-this + get __isLernaPackage() { + // safer than instanceof across module boundaries + return true; + } - if (status === 304) { - throw new requestError.RequestError("Not modified", status, { - response: { - url, - status, - headers, - data: await getResponseData(response) - }, - request: requestOptions - }); - } + // accessors + get version() { + return this[PKG].version; + } - if (status >= 400) { - const data = await getResponseData(response); - const error = new requestError.RequestError(toErrorMessage(data), status, { - response: { - url, - status, - headers, - data - }, - request: requestOptions - }); - throw error; - } + set version(version) { + this[PKG].version = version; + } - return getResponseData(response); - }).then(data => { - return { - status, - url, - headers, - data - }; - }).catch(error => { - if (error instanceof requestError.RequestError) throw error; - throw new requestError.RequestError(error.message, 500, { - request: requestOptions - }); - }); -} + get contents() { + // if modified with setter, use that value + if (this[_contents]) { + return this[_contents]; + } -async function getResponseData(response) { - const contentType = response.headers.get("content-type"); + // if provided by pkg.publishConfig.directory value + if (this[PKG].publishConfig && this[PKG].publishConfig.directory) { + return path.join(this.location, this[PKG].publishConfig.directory); + } - if (/application\/json/.test(contentType)) { - return response.json(); + // default to package root + return this.location; } - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); + set contents(subDirectory) { + this[_contents] = path.join(this.location, subDirectory); } - return getBufferResponse(response); -} - -function toErrorMessage(data) { - if (typeof data === "string") return data; // istanbul ignore else - just in case + // "live" collections + get dependencies() { + return this[PKG].dependencies; + } - if ("message" in data) { - if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; - } + get devDependencies() { + return this[PKG].devDependencies; + } - return data.message; - } // istanbul ignore next - just in case + get optionalDependencies() { + return this[PKG].optionalDependencies; + } + get peerDependencies() { + return this[PKG].peerDependencies; + } - return `Unknown error: ${JSON.stringify(data)}`; -} + /** + * Map-like retrieval of arbitrary values + * @template {keyof RawManifest} K + * @param {K} key field name to retrieve value + * @returns {RawManifest[K]} value stored under key, if present + */ + get(key) { + return this[PKG][key]; + } -function withDefaults(oldEndpoint, newDefaults) { - const endpoint = oldEndpoint.defaults(newDefaults); + /** + * Map-like storage of arbitrary values + * @template {keyof RawManifest} K + * @param {T} key field name to store value + * @param {RawManifest[K]} val value to store + * @returns {Package} instance for chaining + */ + set(key, val) { + this[PKG][key] = val; - const newApi = function (route, parameters) { - const endpointOptions = endpoint.merge(route, parameters); + return this; + } - if (!endpointOptions.request || !endpointOptions.request.hook) { - return fetchWrapper(endpoint.parse(endpointOptions)); - } + /** + * Provide shallow copy for munging elsewhere + * @returns {Object} + */ + toJSON() { + return shallowCopy(this[PKG]); + } - const request = (route, parameters) => { - return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); - }; + /** + * Refresh internal state from disk (e.g., changed by external lifecycles) + */ + refresh() { + return loadJsonFile(this.manifestLocation).then((pkg) => { + this[PKG] = pkg; - Object.assign(request, { - endpoint, - defaults: withDefaults.bind(null, endpoint) + return this; }); - return endpointOptions.request.hook(request, endpointOptions); - }; - - return Object.assign(newApi, { - endpoint, - defaults: withDefaults.bind(null, endpoint) - }); -} - -const request = withDefaults(endpoint.endpoint, { - headers: { - "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}` } -}); - -exports.request = request; -//# sourceMappingURL=index.js.map + /** + * Write manifest changes to disk + * @returns {Promise} resolves when write finished + */ + serialize() { + return writePkg(this.manifestLocation, this[PKG]).then(() => this); + } -/***/ }), + /** + * Mutate local dependency spec according to type + * @param {Object} resolved npa metadata + * @param {String} depVersion semver + * @param {String} savePrefix npm_config_save_prefix + */ + updateLocalDependency(resolved, depVersion, savePrefix) { + const depName = resolved.name; -/***/ 55375: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // first, try runtime dependencies + let depCollection = this.dependencies; -"use strict"; + // try optionalDependencies if that didn't work + if (!depCollection || !depCollection[depName]) { + depCollection = this.optionalDependencies; + } + // fall back to devDependencies + if (!depCollection || !depCollection[depName]) { + depCollection = this.devDependencies; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (resolved.registry || resolved.type === "directory") { + // a version (1.2.3) OR range (^1.2.3) OR directory (file:../foo-pkg) + depCollection[depName] = `${savePrefix}${depVersion}`; + } else if (resolved.gitCommittish) { + // a git url with matching committish (#v1.2.3 or #1.2.3) + const [tagPrefix] = /^\D*/.exec(resolved.gitCommittish); -var core = __nccwpck_require__(76762); -var pluginRequestLog = __nccwpck_require__(68883); -var pluginPaginateRest = __nccwpck_require__(64193); -var pluginRestEndpointMethods = __nccwpck_require__(83044); + // update committish + const { hosted } = resolved; // take that, lint! + hosted.committish = `${tagPrefix}${depVersion}`; -const VERSION = "18.12.0"; + // always serialize the full url (identical to previous resolved.saveSpec) + depCollection[depName] = hosted.toString({ noGitPlus: false, noCommittish: false }); + } else if (resolved.gitRange) { + // a git url with matching gitRange (#semver:^1.2.3) + const { hosted } = resolved; // take that, lint! + hosted.committish = `semver:${savePrefix}${depVersion}`; -const Octokit = core.Octokit.plugin(pluginRequestLog.requestLog, pluginRestEndpointMethods.legacyRestEndpointMethods, pluginPaginateRest.paginateRest).defaults({ - userAgent: `octokit-rest.js/${VERSION}` -}); + // always serialize the full url (identical to previous resolved.saveSpec) + depCollection[depName] = hosted.toString({ noGitPlus: false, noCommittish: false }); + } + } +} -exports.Octokit = Octokit; -//# sourceMappingURL=index.js.map +module.exports.Package = Package; /***/ }), -/***/ 65063: -/***/ ((module) => { +/***/ 24329: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; -}; - - -/***/ }), - -/***/ 52068: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; -/* module decorator */ module = __nccwpck_require__.nmd(module); +const semver = __nccwpck_require__(59897); +module.exports.prereleaseIdFromVersion = prereleaseIdFromVersion; -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; +/** + * @param {string} version + * @returns {string|undefined} + */ +function prereleaseIdFromVersion(version) { + return (semver.prerelease(version) || []).shift(); +} -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; +/***/ }), -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; +/***/ 59853: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + constructor (comp, options) { + options = parseOptions(options) - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } - return value; - }, - enumerable: true, - configurable: true - }); -}; + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = __nccwpck_require__(86931); - } + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } - const offset = isBackground ? 10 : 0; - const styles = {}; + debug('comp', this) + } - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) - return styles; -}; + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; + toString () { + return this.value + } - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + test (version) { + debug('Comparator.test', version, this.options.loose) - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; + if (this.semver === ANY || version === ANY) { + return true + } - group[styleName] = styles[styleName]; + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } - codes.set(style[0], style[1]); - } + return cmp(version, this.operator, this.semver, this.options) + } - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + const sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + const sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + const sameSemVer = this.semver.version === comp.semver.version + const differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + const oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<') + const oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>') - return styles; + return ( + sameDirectionIncreasing || + sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || + oppositeDirectionsGreaterThan + ) + } } -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); - +module.exports = Comparator -/***/ }), +const parseOptions = __nccwpck_require__(25259) +const {re, t} = __nccwpck_require__(69763) +const cmp = __nccwpck_require__(96748) +const debug = __nccwpck_require__(43909) +const SemVer = __nccwpck_require__(31106) +const Range = __nccwpck_require__(85231) -/***/ 83278: -/***/ ((module) => { -"use strict"; +/***/ }), +/***/ 85231: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function isArguments (thingy) { - return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') -} +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) -var types = { - '*': {label: 'any', check: function () { return true }}, - A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, - S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, - N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, - F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, - O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, - B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, - E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, - Z: {label: 'null', check: function (thingy) { return thingy == null }} -} + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } -function addSchema (schema, arity) { - var group = arity[schema.length] = arity[schema.length] || [] - if (group.indexOf(schema) === -1) group.push(schema) -} + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this + } -var validate = module.exports = function (rawSchemas, args) { - if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) - if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') - if (!args) throw missingRequiredArg(1, 'args') - if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) - if (!types.A.check(args)) throw invalidType(1, ['array'], args) - var schemas = rawSchemas.split('|') - var arity = {} + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease - schemas.forEach(function (schema) { - for (var ii = 0; ii < schema.length; ++ii) { - var type = schema[ii] - if (!types[type]) throw unknownType(ii, type) - } - if (/E.*E/.test(schema)) throw moreThanOneError(schema) - addSchema(schema, arity) - if (/E/.test(schema)) { - addSchema(schema.replace(/E.*$/, 'E'), arity) - addSchema(schema.replace(/E/, 'Z'), arity) - if (schema.length === 1) addSchema('', arity) + // First, split based on boolean or || + this.raw = range + this.set = range + .split(/\s*\|\|\s*/) + // map the range to a 2d array of comparators + .map(range => this.parseRange(range.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${range}`) } - }) - var matching = arity[args.length] - if (!matching) { - throw wrongNumberOfArgs(Object.keys(arity), args.length) - } - for (var ii = 0; ii < args.length; ++ii) { - var newMatching = matching.filter(function (schema) { - var type = schema[ii] - var typeCheck = types[type].check - return typeCheck(args[ii]) - }) - if (!newMatching.length) { - var labels = matching.map(function (schema) { - return types[schema[ii]].label - }).filter(function (schema) { return schema != null }) - throw invalidType(ii, labels, args[ii]) + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) + this.set = [first] + else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } } - matching = newMatching - } -} -function missingRequiredArg (num) { - return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) -} + this.format() + } -function unknownType (num, type) { - return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) -} + format () { + this.range = this.set + .map((comps) => { + return comps.join(' ').trim() + }) + .join('||') + .trim() + return this.range + } -function invalidType (num, expectedTypes, value) { - var valueType - Object.keys(types).forEach(function (typeCode) { - if (types[typeCode].check(value)) valueType = types[typeCode].label - }) - return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + - englishList(expectedTypes) + ' but got ' + valueType) -} + toString () { + return this.range + } -function englishList (list) { - return list.join(', ').replace(/, ([^,]+)$/, ' or $1') -} + parseRange (range) { + range = range.trim() -function wrongNumberOfArgs (expected, got) { - var english = englishList(expected) - var args = expected.every(function (ex) { return ex.length === 1 }) - ? 'argument' - : 'arguments' - return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) -} + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = Object.keys(this.options).join(',') + const memoKey = `parseRange:${memoOpts}:${range}` + const cached = cache.get(memoKey) + if (cached) + return cached -function moreThanOneError (schema) { - return newException('ETOOMANYERRORTYPES', - 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') -} + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) -function newException (code, msg) { - var e = new Error(msg) - e.code = code - if (Error.captureStackTrace) Error.captureStackTrace(e, validate) - return e -} + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) -/***/ }), + // normalize spaces + range = range.split(/\s+/).join(' ') -/***/ 11083: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // At this point, the range is completely trimmed and + // ready to be split into comparators. -"use strict"; + const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + // in loose mode, throw out any that are not valid comparators + .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) + .map(comp => new Comparator(comp, this.options)) -exports.TrackerGroup = __nccwpck_require__(60660) -exports.Tracker = __nccwpck_require__(8074) -exports.TrackerStream = __nccwpck_require__(31375) + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const l = rangeList.length + const rangeMap = new Map() + for (const comp of rangeList) { + if (isNullSet(comp)) + return [comp] + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) + rangeMap.delete('') + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } -/***/ }), + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } -/***/ 10165: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } -"use strict"; + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } -var EventEmitter = __nccwpck_require__(28614).EventEmitter -var util = __nccwpck_require__(31669) + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } -var trackerId = 0 -var TrackerBase = module.exports = function (name) { - EventEmitter.call(this) - this.id = ++trackerId - this.name = name + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } } -util.inherits(TrackerBase, EventEmitter) - - -/***/ }), - -/***/ 60660: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +module.exports = Range -"use strict"; +const LRU = __nccwpck_require__(7129) +const cache = new LRU({ max: 1000 }) -var util = __nccwpck_require__(31669) -var TrackerBase = __nccwpck_require__(10165) -var Tracker = __nccwpck_require__(8074) -var TrackerStream = __nccwpck_require__(31375) +const parseOptions = __nccwpck_require__(25259) +const Comparator = __nccwpck_require__(59853) +const debug = __nccwpck_require__(43909) +const SemVer = __nccwpck_require__(31106) +const { + re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace +} = __nccwpck_require__(69763) -var TrackerGroup = module.exports = function (name) { - TrackerBase.call(this, name) - this.parentGroup = null - this.trackers = [] - this.completion = {} - this.weight = {} - this.totalWeight = 0 - this.finished = false - this.bubbleChange = bubbleChange(this) -} -util.inherits(TrackerGroup, TrackerBase) +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' -function bubbleChange (trackerGroup) { - return function (name, completed, tracker) { - trackerGroup.completion[tracker.id] = completed - if (trackerGroup.finished) return - trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) - } -} +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() -TrackerGroup.prototype.nameInTree = function () { - var names = [] - var from = this - while (from) { - names.unshift(from.name) - from = from.parentGroup - } - return names.join('/') -} + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) -TrackerGroup.prototype.addUnit = function (unit, weight) { - if (unit.addUnit) { - var toTest = this - while (toTest) { - if (unit === toTest) { - throw new Error( - 'Attempted to add tracker group ' + - unit.name + ' to tree that already includes it ' + - this.nameInTree(this)) - } - toTest = toTest.parentGroup - } - unit.parentGroup = this + testComparator = remainingComparators.pop() } - this.weight[unit.id] = weight || 1 - this.totalWeight += this.weight[unit.id] - this.trackers.push(unit) - this.completion[unit.id] = unit.completed() - unit.on('change', this.bubbleChange) - if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) - return unit -} -TrackerGroup.prototype.completed = function () { - if (this.trackers.length === 0) return 0 - var valPerWeight = 1 / this.totalWeight - var completed = 0 - for (var ii = 0; ii < this.trackers.length; ii++) { - var trackerId = this.trackers[ii].id - completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] - } - return completed + return result } -TrackerGroup.prototype.newGroup = function (name, weight) { - return this.addUnit(new TrackerGroup(name), weight) +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp } -TrackerGroup.prototype.newItem = function (name, todo, weight) { - return this.addUnit(new Tracker(name, todo), weight) -} +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' -TrackerGroup.prototype.newStream = function (name, todo, weight) { - return this.addUnit(new TrackerStream(name, todo), weight) -} +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +const replaceTildes = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceTilde(comp, options) + }).join(' ') -TrackerGroup.prototype.finish = function () { - this.finished = true - if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) - for (var ii = 0; ii < this.trackers.length; ii++) { - var tracker = this.trackers[ii] - tracker.finish() - tracker.removeListener('change', this.bubbleChange) - } - this.emit('change', this.name, 1, this) -} +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret -var buffer = ' ' -TrackerGroup.prototype.debug = function (depth) { - depth = depth || 0 - var indent = depth ? buffer.substr(0, depth) : '' - var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' - this.trackers.forEach(function (tracker) { - if (tracker instanceof TrackerGroup) { - output += tracker.debug(depth + 1) + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` } else { - output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` } + + debug('tilde return', ret) + return ret }) - return output } +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +const replaceCarets = (comp, options) => + comp.trim().split(/\s+/).map((comp) => { + return replaceCaret(comp, options) + }).join(' ') -/***/ }), - -/***/ 31375: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret -var util = __nccwpck_require__(31669) -var stream = __nccwpck_require__(51642) -var delegate = __nccwpck_require__(61318) -var Tracker = __nccwpck_require__(8074) + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } -var TrackerStream = module.exports = function (name, size, options) { - stream.Transform.call(this, options) - this.tracker = new Tracker(name, size) - this.name = name - this.id = this.tracker.id - this.tracker.on('change', delegateChange(this)) + debug('caret return', ret) + return ret + }) } -util.inherits(TrackerStream, stream.Transform) -function delegateChange (trackerStream) { - return function (name, completion, tracker) { - trackerStream.emit('change', name, completion, trackerStream) - } +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map((comp) => { + return replaceXRange(comp, options) + }).join(' ') } -TrackerStream.prototype._transform = function (data, encoding, cb) { - this.tracker.completeWork(data.length ? data.length : 1) - this.push(data) - cb() -} - -TrackerStream.prototype._flush = function (cb) { - this.tracker.finish() - cb() -} - -delegate(TrackerStream.prototype, 'tracker') - .method('completed') - .method('addWork') - .method('finish') +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + if (gtlt === '=' && anyX) { + gtlt = '' + } -/***/ }), + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' -/***/ 8074: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 -"use strict"; + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } -var util = __nccwpck_require__(31669) -var TrackerBase = __nccwpck_require__(10165) + if (gtlt === '<') + pr = '-0' -var Tracker = module.exports = function (name, todo) { - TrackerBase.call(this, name) - this.workDone = 0 - this.workTodo = todo || 0 -} -util.inherits(Tracker, TrackerBase) + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } -Tracker.prototype.completed = function () { - return this.workTodo === 0 ? 0 : this.workDone / this.workTodo -} + debug('xRange return', ret) -Tracker.prototype.addWork = function (work) { - this.workTodo += work - this.emit('change', this.name, this.completed(), this) + return ret + }) } -Tracker.prototype.completeWork = function (work) { - this.workDone += work - if (this.workDone > this.workTodo) this.workDone = this.workTodo - this.emit('change', this.name, this.completed(), this) +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[t.STAR], '') } -Tracker.prototype.finish = function () { - this.workTodo = this.workDone = 1 - this.emit('change', this.name, 1, this) +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp.trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } -/***/ }), - -/***/ 28912: -/***/ ((module) => { - -"use strict"; - -module.exports = function(val) { - return Array.isArray(val) ? val : [val]; -}; - - -/***/ }), - -/***/ 33415: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// Packages -var retrier = __nccwpck_require__(24347); - -function retry(fn, opts) { - function run(resolve, reject) { - var options = opts || {}; - var op; - - // Default `randomize` to true - if (!('randomize' in options)) { - options.randomize = true; - } - - op = retrier.operation(options); + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } - // We allow the user to abort retrying - // this makes sense in the cases where - // knowledge is obtained that retrying - // would be futile (e.g.: auth errors) + return (`${from} ${to}`).trim() +} - function bail(err) { - reject(err || new Error('Aborted')); +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false } + } - function onError(err, num) { - if (err.bail) { - bail(err); - return; - } - - if (!op.retry(err)) { - reject(op.mainError()); - } else if (options.onRetry) { - options.onRetry(err, num); + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue } - } - - function runAttempt(num) { - var val; - try { - val = fn(bail, num); - } catch (err) { - onError(err, num); - return; + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } } - - Promise.resolve(val) - .then(resolve) - .catch(function catchIt(err) { - onError(err, num); - }); } - op.attempt(runAttempt); + // Version has a -pre, but it's not one of the ones we like. + return false } - return new Promise(run); + return true } -module.exports = retry; - /***/ }), -/***/ 83682: +/***/ 31106: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var register = __nccwpck_require__(44670) -var addHook = __nccwpck_require__(5549) -var removeHook = __nccwpck_require__(6819) - -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind -var bindable = bind.bind(bind) - -function bindApi (hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) - hook.api = { remove: removeHookRef } - hook.remove = removeHookRef - - ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind] - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) - }) -} +const debug = __nccwpck_require__(43909) +const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(49407) +const { re, t } = __nccwpck_require__(69763) -function HookSingular () { - var singularHookName = 'h' - var singularHookState = { - registry: {} - } - var singularHook = register.bind(null, singularHookState, singularHookName) - bindApi(singularHook, singularHookState, singularHookName) - return singularHook -} +const parseOptions = __nccwpck_require__(25259) +const { compareIdentifiers } = __nccwpck_require__(6022) +class SemVer { + constructor (version, options) { + options = parseOptions(options) -function HookCollection () { - var state = { - registry: {} - } + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid Version: ${version}`) + } - var hook = register.bind(null, state) - bindApi(hook, state) + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } - return hook -} + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease -var collectionHookDeprecationMessageDisplayed = false -function Hook () { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') - collectionHookDeprecationMessageDisplayed = true - } - return HookCollection() -} + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) -Hook.Singular = HookSingular.bind() -Hook.Collection = HookCollection.bind() + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } -module.exports = Hook -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook -module.exports.Singular = Hook.Singular -module.exports.Collection = Hook.Collection + this.raw = version + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] -/***/ }), + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } -/***/ 5549: -/***/ ((module) => { + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } -module.exports = addHook; + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); - }; + this.build = m[5] ? m[5].split('.') : [] + this.format() } - if (kind === "after") { - hook = function (method, options) { - var result; - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_; - return orig(result, options); - }) - .then(function () { - return result; - }); - }; + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version } - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; + toString () { + return this.version } - state.registry[name].push({ - hook: hook, - orig: orig, - }); -} - - -/***/ }), - -/***/ 44670: -/***/ ((module) => { + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } -module.exports = register; + if (other.version === this.version) { + return 0 + } -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); + return this.compareMain(other) || this.comparePre(other) } - if (!options) { - options = {}; - } + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) } - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) } - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); - }); -} - - -/***/ }), - -/***/ 6819: -/***/ ((module) => { - -module.exports = removeHook; + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) } - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - if (index === -1) { - return; + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) } - state.registry[name].splice(index, 1); -} - + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.format() + this.raw = this.version + return this + } +} + +module.exports = SemVer + /***/ }), -/***/ 44159: -/***/ ((module) => { +/***/ 95637: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(32217) +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean -module.exports = { - trueFunc: function trueFunc(){ - return true; - }, - falseFunc: function falseFunc(){ - return false; - } -}; /***/ }), -/***/ 78818: +/***/ 96748: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const eq = __nccwpck_require__(78426) +const neq = __nccwpck_require__(54024) +const gt = __nccwpck_require__(45127) +const gte = __nccwpck_require__(22605) +const lt = __nccwpck_require__(7618) +const lte = __nccwpck_require__(74385) -const ansiStyles = __nccwpck_require__(52068); -const {stdout: stdoutColor, stderr: stderrColor} = __nccwpck_require__(59318); -const { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -} = __nccwpck_require__(82415); +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b -const {isArray} = Array; + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b -// `supportsColor.level` → `ansiStyles.color[name]` mapping -const levelMapping = [ - 'ansi', - 'ansi', - 'ansi256', - 'ansi16m' -]; + case '': + case '=': + case '==': + return eq(a, b, loose) -const styles = Object.create(null); + case '!=': + return neq(a, b, loose) -const applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error('The `level` option should be an integer from 0 to 3'); - } + case '>': + return gt(a, b, loose) - // Detect level if not set manually - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === undefined ? colorLevel : options.level; -}; + case '>=': + return gte(a, b, loose) -class ChalkClass { - constructor(options) { - // eslint-disable-next-line no-constructor-return - return chalkFactory(options); - } + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } } +module.exports = cmp -const chalkFactory = options => { - const chalk = {}; - applyOptions(chalk, options); - chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); +/***/ }), - Object.setPrototypeOf(chalk, Chalk.prototype); - Object.setPrototypeOf(chalk.template, chalk); +/***/ 85182: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - chalk.template.constructor = () => { - throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); - }; +const SemVer = __nccwpck_require__(31106) +const parse = __nccwpck_require__(32217) +const {re, t} = __nccwpck_require__(69763) - chalk.template.Instance = ChalkClass; +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } - return chalk.template; -}; + if (typeof version === 'number') { + version = String(version) + } -function Chalk(options) { - return chalkFactory(options); -} + if (typeof version !== 'string') { + return null + } -for (const [styleName, style] of Object.entries(ansiStyles)) { - styles[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); - Object.defineProperty(this, styleName, {value: builder}); - return builder; - } - }; -} + options = options || {} -styles.visible = { - get() { - const builder = createBuilder(this, this._styler, true); - Object.defineProperty(this, 'visible', {value: builder}); - return builder; - } -}; + let match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + let next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } -const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; + if (match === null) + return null -for (const model of usedModels) { - styles[model] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; + return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } +module.exports = coerce -for (const model of usedModels) { - const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); - styles[bgModel] = { - get() { - const {level} = this; - return function (...arguments_) { - const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); - return createBuilder(this, styler, this._isEmpty); - }; - } - }; -} -const proto = Object.defineProperties(() => {}, { - ...styles, - level: { - enumerable: true, - get() { - return this._generator.level; - }, - set(level) { - this._generator.level = level; - } - } -}); +/***/ }), -const createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === undefined) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } +/***/ 22020: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return { - open, - close, - openAll, - closeAll, - parent - }; -}; +const SemVer = __nccwpck_require__(31106) +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild -const createBuilder = (self, _styler, _isEmpty) => { - const builder = (...arguments_) => { - if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { - // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` - return applyStyle(builder, chalkTag(builder, ...arguments_)); - } - // Single argument is hot path, implicit coercion is faster than anything - // eslint-disable-next-line no-implicit-coercion - return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); - }; +/***/ }), - // We alter the prototype because we must return a function, but there is - // no way to create a function with a different prototype - Object.setPrototypeOf(builder, proto); +/***/ 21991: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - builder._generator = self; - builder._styler = _styler; - builder._isEmpty = _isEmpty; +const compare = __nccwpck_require__(65857) +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose - return builder; -}; -const applyStyle = (self, string) => { - if (self.level <= 0 || !string) { - return self._isEmpty ? '' : string; - } +/***/ }), - let styler = self._styler; +/***/ 65857: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (styler === undefined) { - return string; - } +const SemVer = __nccwpck_require__(31106) +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) - const {openAll, closeAll} = styler; - if (string.indexOf('\u001B') !== -1) { - while (styler !== undefined) { - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - string = stringReplaceAll(string, styler.close, styler.open); +module.exports = compare - styler = styler.parent; - } - } - // We can move both next actions out of loop, because remaining actions in loop won't have - // any/visible effect on parts we add here. Close the styling before a linebreak and reopen - // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 - const lfIndex = string.indexOf('\n'); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } +/***/ }), - return openAll + string + closeAll; -}; +/***/ 17693: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -let template; -const chalkTag = (chalk, ...strings) => { - const [firstString] = strings; +const parse = __nccwpck_require__(32217) +const eq = __nccwpck_require__(78426) - if (!isArray(firstString) || !isArray(firstString.raw)) { - // If chalk() was called by itself or with a string, - // return the string itself as a string. - return strings.join(' '); - } +const diff = (version1, version2) => { + if (eq(version1, version2)) { + return null + } else { + const v1 = parse(version1) + const v2 = parse(version2) + const hasPre = v1.prerelease.length || v2.prerelease.length + const prefix = hasPre ? 'pre' : '' + const defaultResult = hasPre ? 'prerelease' : '' + for (const key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} +module.exports = diff - const arguments_ = strings.slice(1); - const parts = [firstString.raw[0]]; - for (let i = 1; i < firstString.length; i++) { - parts.push( - String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), - String(firstString.raw[i]) - ); - } +/***/ }), - if (template === undefined) { - template = __nccwpck_require__(20500); - } +/***/ 78426: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return template(chalk, parts.join('')); -}; +const compare = __nccwpck_require__(65857) +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq -Object.defineProperties(Chalk.prototype, styles); -const chalk = Chalk(); // eslint-disable-line new-cap -chalk.supportsColor = stdoutColor; -chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap -chalk.stderr.supportsColor = stderrColor; +/***/ }), -module.exports = chalk; +/***/ 45127: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const compare = __nccwpck_require__(65857) +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt /***/ }), -/***/ 20500: -/***/ ((module) => { +/***/ 22605: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const compare = __nccwpck_require__(65857) +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte -const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; -const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; -const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; -const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; -const ESCAPES = new Map([ - ['n', '\n'], - ['r', '\r'], - ['t', '\t'], - ['b', '\b'], - ['f', '\f'], - ['v', '\v'], - ['0', '\0'], - ['\\', '\\'], - ['e', '\u001B'], - ['a', '\u0007'] -]); +/***/ }), -function unescape(c) { - const u = c[0] === 'u'; - const bracket = c[1] === '{'; +/***/ 53693: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { - return String.fromCharCode(parseInt(c.slice(1), 16)); - } +const SemVer = __nccwpck_require__(31106) - if (u && bracket) { - return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); - } +const inc = (version, release, options, identifier) => { + if (typeof (options) === 'string') { + identifier = options + options = undefined + } - return ESCAPES.get(c) || c; + try { + return new SemVer(version, options).inc(release, identifier).version + } catch (er) { + return null + } } +module.exports = inc -function parseArguments(name, arguments_) { - const results = []; - const chunks = arguments_.trim().split(/\s*,\s*/g); - let matches; - for (const chunk of chunks) { - const number = Number(chunk); - if (!Number.isNaN(number)) { - results.push(number); - } else if ((matches = chunk.match(STRING_REGEX))) { - results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); - } else { - throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); - } - } +/***/ }), - return results; -} +/***/ 7618: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -function parseStyle(style) { - STYLE_REGEX.lastIndex = 0; +const compare = __nccwpck_require__(65857) +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt - const results = []; - let matches; - while ((matches = STYLE_REGEX.exec(style)) !== null) { - const name = matches[1]; +/***/ }), - if (matches[2]) { - const args = parseArguments(name, matches[2]); - results.push([name].concat(args)); - } else { - results.push([name]); - } - } +/***/ 74385: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return results; -} +const compare = __nccwpck_require__(65857) +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte -function buildStyle(chalk, styles) { - const enabled = {}; - for (const layer of styles) { - for (const style of layer.styles) { - enabled[style[0]] = layer.inverse ? null : style.slice(1); - } - } +/***/ }), - let current = chalk; - for (const [styleName, styles] of Object.entries(enabled)) { - if (!Array.isArray(styles)) { - continue; - } +/***/ 69534: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (!(styleName in current)) { - throw new Error(`Unknown Chalk style: ${styleName}`); - } +const SemVer = __nccwpck_require__(31106) +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major - current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; - } - return current; -} +/***/ }), -module.exports = (chalk, temporary) => { - const styles = []; - const chunks = []; - let chunk = []; +/***/ 21167: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - // eslint-disable-next-line max-params - temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { - if (escapeCharacter) { - chunk.push(unescape(escapeCharacter)); - } else if (style) { - const string = chunk.join(''); - chunk = []; - chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); - styles.push({inverse, styles: parseStyle(style)}); - } else if (close) { - if (styles.length === 0) { - throw new Error('Found extraneous } in Chalk template literal'); - } +const SemVer = __nccwpck_require__(31106) +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor - chunks.push(buildStyle(chalk, styles)(chunk.join(''))); - chunk = []; - styles.pop(); - } else { - chunk.push(character); - } - }); - chunks.push(chunk.join('')); +/***/ }), - if (styles.length > 0) { - const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; - throw new Error(errMessage); - } +/***/ 54024: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return chunks.join(''); -}; +const compare = __nccwpck_require__(65857) +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq /***/ }), -/***/ 82415: -/***/ ((module) => { +/***/ 32217: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const {MAX_LENGTH} = __nccwpck_require__(49407) +const { re, t } = __nccwpck_require__(69763) +const SemVer = __nccwpck_require__(31106) +const parseOptions = __nccwpck_require__(25259) +const parse = (version, options) => { + options = parseOptions(options) -const stringReplaceAll = (string, substring, replacer) => { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } + if (version instanceof SemVer) { + return version + } - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ''; - do { - returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); + if (typeof version !== 'string') { + return null + } - returnValue += string.substr(endIndex); - return returnValue; -}; + if (version.length > MAX_LENGTH) { + return null + } -const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { - let endIndex = 0; - let returnValue = ''; - do { - const gotCR = string[index - 1] === '\r'; - returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; - endIndex = index + 1; - index = string.indexOf('\n', endIndex); - } while (index !== -1); + const r = options.loose ? re[t.LOOSE] : re[t.FULL] + if (!r.test(version)) { + return null + } - returnValue += string.substr(endIndex); - return returnValue; -}; + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} -module.exports = { - stringReplaceAll, - stringEncaseCRLFWithFirstIndex -}; +module.exports = parse /***/ }), -/***/ 68929: -/***/ ((module) => { - -"use strict"; -/* eslint-disable babel/new-cap, xo/throw-new-error */ +/***/ 82862: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = function (str, pos) { - if (str === null || str === undefined) { - throw TypeError(); - } +const SemVer = __nccwpck_require__(31106) +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch - str = String(str); - var size = str.length; - var i = pos ? Number(pos) : 0; +/***/ }), - if (Number.isNaN(i)) { - i = 0; - } +/***/ 45493: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (i < 0 || i >= size) { - return undefined; - } +const parse = __nccwpck_require__(32217) +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease - var first = str.charCodeAt(i); - if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { - var second = str.charCodeAt(i + 1); +/***/ }), - if (second >= 0xDC00 && second <= 0xDFFF) { - return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000; - } - } +/***/ 17861: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return first; -}; +const compare = __nccwpck_require__(65857) +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare /***/ }), -/***/ 9558: -/***/ ((__unused_webpack_module, exports) => { +/***/ 89712: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const compareBuild = __nccwpck_require__(22020) +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.addReviewCommentsDefaults = exports.addPullRequestDefaults = void 0; -const DEFAULT_BRANCH_NAME = 'code-suggestions'; -const DEFAULT_PRIMARY_BRANCH = 'main'; -const DEFAULT_PAGE_SIZE = 100; -/** - * Add defaults to GitHub Pull Request options. - * Preserves the empty string. - * For ESCMAScript, null/undefined values are preserved for required fields. - * Recommended with an object validation function to check empty strings and incorrect types. - * @param {PullRequestUserOptions} options the user-provided github pull request options - * @returns {CreatePullRequest} git hub context with defaults applied - */ -function addPullRequestDefaults(options) { - const pullRequestSettings = { - upstreamOwner: options.upstreamOwner, - upstreamRepo: options.upstreamRepo, - description: options.description, - title: options.title, - message: options.message, - force: options.force || false, - branch: typeof options.branch === 'string' ? options.branch : DEFAULT_BRANCH_NAME, - primary: typeof options.primary === 'string' - ? options.primary - : DEFAULT_PRIMARY_BRANCH, - maintainersCanModify: options.maintainersCanModify === false ? false : true, - }; - return pullRequestSettings; -} -exports.addPullRequestDefaults = addPullRequestDefaults; -/** - * Format user input for pull request review comments - * @param options The user's options input for review comments - * @returns the formatted version of user input for pull request review comments - */ -function addReviewCommentsDefaults(options) { - const createReviewComment = { - repo: options.repo, - owner: options.owner, - pullNumber: options.pullNumber, - // if zero set as 0 - pageSize: options.pageSize === null || options.pageSize === undefined - ? DEFAULT_PAGE_SIZE - : options.pageSize, - }; - return createReviewComment; + +/***/ }), + +/***/ 65240: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(85231) +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) } -exports.addReviewCommentsDefaults = addReviewCommentsDefaults; -//# sourceMappingURL=default-options-handler.js.map +module.exports = satisfies + /***/ }), -/***/ 58021: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 53955: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const compareBuild = __nccwpck_require__(22020) +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.branch = exports.createBranch = exports.existsBranchWithName = exports.getBranchHead = exports.createRef = void 0; -const logger_1 = __nccwpck_require__(58192); -const REF_PREFIX = 'refs/heads/'; -const DEFAULT_PRIMARY_BRANCH = 'main'; -/** - * Create a new branch reference with the ref prefix - * @param {string} branchName name of the branch - */ -function createRef(branchName) { - return REF_PREFIX + branchName; -} -exports.createRef = createRef; -/** - * get branch commit HEAD SHA of a repository - * Throws an error if the branch cannot be found - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} origin The domain information of the remote origin repository - * @param {string} branch the name of the branch - * @returns {Promise} branch commit HEAD SHA - */ -async function getBranchHead(octokit, origin, branch) { - const branchData = (await octokit.repos.getBranch({ - owner: origin.owner, - repo: origin.repo, - branch, - })).data; - logger_1.logger.info(`Successfully found branch HEAD sha "${branchData.commit.sha}".`); - return branchData.commit.sha; + +/***/ }), + +/***/ 11111: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const parse = __nccwpck_require__(32217) +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null } -exports.getBranchHead = getBranchHead; -/** - * Determine if there is a branch with the provided name in the remote GitHub repository - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} remote The domain information of the remote repository - * @param {string} name The branch name to create on the repository - * @returns {Promise} if there is a branch already existing in the remote GitHub repository - */ -async function existsBranchWithName(octokit, remote, name) { - try { - const data = (await octokit.git.getRef({ - owner: remote.owner, - repo: remote.repo, - ref: `heads/${name}`, - })).data; - return data.ref ? true : false; - } - catch (err) { - if (err.status === 404) - return false; - else - throw err; - } +module.exports = valid + + +/***/ }), + +/***/ 59897: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// just pre-load all the stuff that index.js lazily exports +const internalRe = __nccwpck_require__(69763) +module.exports = { + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: __nccwpck_require__(49407).SEMVER_SPEC_VERSION, + SemVer: __nccwpck_require__(31106), + compareIdentifiers: __nccwpck_require__(6022).compareIdentifiers, + rcompareIdentifiers: __nccwpck_require__(6022).rcompareIdentifiers, + parse: __nccwpck_require__(32217), + valid: __nccwpck_require__(11111), + clean: __nccwpck_require__(95637), + inc: __nccwpck_require__(53693), + diff: __nccwpck_require__(17693), + major: __nccwpck_require__(69534), + minor: __nccwpck_require__(21167), + patch: __nccwpck_require__(82862), + prerelease: __nccwpck_require__(45493), + compare: __nccwpck_require__(65857), + rcompare: __nccwpck_require__(17861), + compareLoose: __nccwpck_require__(21991), + compareBuild: __nccwpck_require__(22020), + sort: __nccwpck_require__(53955), + rsort: __nccwpck_require__(89712), + gt: __nccwpck_require__(45127), + lt: __nccwpck_require__(7618), + eq: __nccwpck_require__(78426), + neq: __nccwpck_require__(54024), + gte: __nccwpck_require__(22605), + lte: __nccwpck_require__(74385), + cmp: __nccwpck_require__(96748), + coerce: __nccwpck_require__(85182), + Comparator: __nccwpck_require__(59853), + Range: __nccwpck_require__(85231), + satisfies: __nccwpck_require__(65240), + toComparators: __nccwpck_require__(77948), + maxSatisfying: __nccwpck_require__(93577), + minSatisfying: __nccwpck_require__(77435), + minVersion: __nccwpck_require__(29118), + validRange: __nccwpck_require__(59158), + outside: __nccwpck_require__(22122), + gtr: __nccwpck_require__(56463), + ltr: __nccwpck_require__(9874), + intersects: __nccwpck_require__(54385), + simplifyRange: __nccwpck_require__(78449), + subset: __nccwpck_require__(44018), +} + + +/***/ }), + +/***/ 49407: +/***/ ((module) => { + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +module.exports = { + SEMVER_SPEC_VERSION, + MAX_LENGTH, + MAX_SAFE_INTEGER, + MAX_SAFE_COMPONENT_LENGTH } -exports.existsBranchWithName = existsBranchWithName; -/** - * Create a branch on the remote repository if there is not an existing branch - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} remote The domain information of the remote origin repository - * @param {string} name The branch name to create on the origin repository - * @param {string} baseSha the sha that the base of the reference points to - * @param {boolean} duplicate whether there is an existing branch or not - * @returns {Promise} - */ -async function createBranch(octokit, remote, name, baseSha, duplicate) { - if (!duplicate) { - const refData = (await octokit.git.createRef({ - owner: remote.owner, - repo: remote.repo, - ref: createRef(name), - sha: baseSha, - })).data; - logger_1.logger.info(`Successfully created branch at ${refData.url}`); - } - else { - logger_1.logger.info('Skipping branch creation step...'); - } + + +/***/ }), + +/***/ 43909: +/***/ ((module) => { + +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug + + +/***/ }), + +/***/ 6022: +/***/ ((module) => { + +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 } -exports.createBranch = createBranch; -/** - * Create a GitHub branch given a remote origin. - * Throws an exception if octokit fails, or if the base branch is invalid - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} origin The domain information of the remote origin repository - * @param {RepoDomain} upstream The domain information of the remote upstream repository - * @param {string} name The branch name to create on the origin repository - * @param {string} baseBranch the name of the branch to base the new branch off of. Default is main - * @returns {Promise} the base SHA for subsequent commits to be based off for the origin branch - */ -async function branch(octokit, origin, upstream, name, baseBranch = DEFAULT_PRIMARY_BRANCH) { - // create branch from primary branch HEAD SHA - try { - const baseSha = await getBranchHead(octokit, upstream, baseBranch); - const duplicate = await existsBranchWithName(octokit, origin, name); - await createBranch(octokit, origin, name, baseSha, duplicate); - return baseSha; - } - catch (err) { - logger_1.logger.error('Error when creating branch'); - throw err; - } + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers } -exports.branch = branch; -//# sourceMappingURL=branch.js.map + /***/ }), -/***/ 4424: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 25259: +/***/ ((module) => { -"use strict"; +// parse out just the options we care about so we always get a consistent +// obj with keys in a consistent order. +const opts = ['includePrerelease', 'loose', 'rtl'] +const parseOptions = options => + !options ? {} + : typeof options !== 'object' ? { loose: true } + : opts.filter(k => options[k]).reduce((options, k) => { + options[k] = true + return options + }, {}) +module.exports = parseOptions -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.commitAndPush = exports.updateRef = exports.createCommit = exports.createTree = exports.generateTreeObjects = void 0; -const logger_1 = __nccwpck_require__(58192); -/** - * Generate and return a GitHub tree object structure - * containing the target change data - * See https://developer.github.com/v3/git/trees/#tree-object - * @param {Changes} changes the set of repository changes - * @returns {TreeObject[]} The new GitHub changes - */ -function generateTreeObjects(changes) { - const tree = []; - changes.forEach((fileData, path) => { - if (fileData.content === null) { - // if no file content then file is deleted - tree.push({ - path, - mode: fileData.mode, - type: 'blob', - sha: null, - }); - } - else { - // update file with its content - tree.push({ - path, - mode: fileData.mode, - type: 'blob', - content: fileData.content, - }); - } - }); - return tree; -} -exports.generateTreeObjects = generateTreeObjects; -/** - * Upload and create a remote GitHub tree - * and resolves with the new tree SHA. - * Rejects if GitHub V3 API fails with the GitHub error response - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} origin the the remote repository to push changes to - * @param {string} refHead the base of the new commit(s) - * @param {TreeObject[]} tree the set of GitHub changes to upload - * @returns {Promise} the GitHub tree SHA - */ -async function createTree(octokit, origin, refHead, tree) { - const oldTreeSha = (await octokit.git.getCommit({ - owner: origin.owner, - repo: origin.repo, - commit_sha: refHead, - })).data.tree.sha; - logger_1.logger.info('Got the latest commit tree'); - const treeSha = (await octokit.git.createTree({ - owner: origin.owner, - repo: origin.repo, - tree, - base_tree: oldTreeSha, - })).data.sha; - logger_1.logger.info(`Successfully created a tree with the desired changes with SHA ${treeSha}`); - return treeSha; -} -exports.createTree = createTree; -/** - * Create a commit with a repo snapshot SHA on top of the reference HEAD - * and resolves with the SHA of the commit. - * Rejects if GitHub V3 API fails with the GitHub error response - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} origin the the remote repository to push changes to - * @param {string} refHead the base of the new commit(s) - * @param {string} treeSha the tree SHA that this commit will point to - * @param {string} message the message of the new commit - * @returns {Promise} the new commit SHA - */ -async function createCommit(octokit, origin, refHead, treeSha, message) { - const commitData = (await octokit.git.createCommit({ - owner: origin.owner, - repo: origin.repo, - message, - tree: treeSha, - parents: [refHead], - })).data; - logger_1.logger.info(`Successfully created commit. See commit at ${commitData.url}`); - return commitData.sha; -} -exports.createCommit = createCommit; -/** - * Update a reference to a SHA - * Rejects if GitHub V3 API fails with the GitHub error response - * @param {Octokit} octokit The authenticated octokit instance - * @param {BranchDomain} origin the the remote branch to push changes to - * @param {string} newSha the ref to update the commit HEAD to - * @param {boolean} force to force the commit changes given refHead - * @returns {Promise} - */ -async function updateRef(octokit, origin, newSha, force) { - await octokit.git.updateRef({ - owner: origin.owner, - repo: origin.repo, - ref: `heads/${origin.branch}`, - sha: newSha, - force, - }); - logger_1.logger.info(`Successfully updated reference ${origin.branch} to ${newSha}`); -} -exports.updateRef = updateRef; -/** - * Given a set of changes, apply the commit(s) on top of the given branch's head and upload it to GitHub - * Rejects if GitHub V3 API fails with the GitHub error response - * @param {Octokit} octokit The authenticated octokit instance - * @param {string} refHead the base of the new commit(s) - * @param {Changes} changes the set of repository changes - * @param {RepoDomain} origin the the remote repository to push changes to - * @param {string} originBranchName the remote branch that will contain the new changes - * @param {string} commitMessage the message of the new commit - * @param {boolean} force to force the commit changes given refHead - * @returns {Promise} - */ -async function commitAndPush(octokit, refHead, changes, originBranch, commitMessage, force) { - try { - const tree = generateTreeObjects(changes); - const treeSha = await createTree(octokit, originBranch, refHead, tree); - const commitSha = await createCommit(octokit, originBranch, refHead, treeSha, commitMessage); - await updateRef(octokit, originBranch, commitSha, force); - } - catch (err) { - err.message = `Error while creating a tree and updating the ref: ${err.message}`; - logger_1.logger.error(err); - throw err; - } + +/***/ }), + +/***/ 69763: +/***/ ((module, exports, __nccwpck_require__) => { + +const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(49407) +const debug = __nccwpck_require__(43909) +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const createToken = (name, value, isGlobal) => { + const index = R++ + debug(index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) } -exports.commitAndPush = commitAndPush; -//# sourceMappingURL=commit-and-push.js.map + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCE', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') + /***/ }), -/***/ 67386: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 56463: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +// Determine if version is greater than all the versions possible in the range. +const outside = __nccwpck_require__(22122) +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.fork = void 0; -const logger_1 = __nccwpck_require__(58192); -/** - * Fork the GitHub owner's repository. - * Returns the fork owner and fork repo when the fork creation request to GitHub succeeds. - * Otherwise throws error. - * - * If fork already exists no new fork is created, no error occurs, and the existing Fork data is returned - * with the `updated_at` + any historical repo changes. - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} upstream upstream repository information - * @returns {Promise} the forked repository name, as well as the owner of that fork - */ -async function fork(octokit, upstream) { - try { - const forkedRepo = (await octokit.repos.createFork({ - owner: upstream.owner, - repo: upstream.repo, - })).data; - const origin = { - repo: forkedRepo.name, - owner: forkedRepo.owner.login, - }; - logger_1.logger.info(`Create fork request was successful for ${origin.owner}/${origin.repo}`); - return origin; - } - catch (err) { - logger_1.logger.error('Error when forking'); - throw Error(err.toString()); - } + +/***/ }), + +/***/ 54385: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const Range = __nccwpck_require__(85231) +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) } -exports.fork = fork; -//# sourceMappingURL=fork.js.map +module.exports = intersects + /***/ }), -/***/ 8831: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 9874: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const outside = __nccwpck_require__(22122) +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.addLabels = void 0; -const logger_1 = __nccwpck_require__(58192); -/** - * Create a GitHub PR on the upstream organization's repo - * Throws an error if the GitHub API fails - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} upstream The upstream repository - * @param {BranchDomain} origin The remote origin information that contains the origin branch - * @param {number} issue_number The issue number to add labels to. Can also be a PR number - * @param {string[]} labels The list of labels to apply to the issue/pull request. Default is []. the funciton will no-op. - * @returns {Promise} The list of resulting labels after the addition of the given labels - */ -async function addLabels(octokit, upstream, origin, issue_number, labels) { - if (!labels || labels.length === 0) { - return []; + +/***/ }), + +/***/ 93577: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +const SemVer = __nccwpck_require__(31106) +const Range = __nccwpck_require__(85231) + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } } - const labelsResponseData = (await octokit.issues.addLabels({ - owner: upstream.owner, - repo: origin.repo, - issue_number: issue_number, - labels: labels, - })).data; - logger_1.logger.info(`Successfully added labels ${labels} to issue: ${issue_number}`); - return labelsResponseData.map(l => l.name); + }) + return max } -exports.addLabels = addLabels; -//# sourceMappingURL=labels.js.map +module.exports = maxSatisfying -/***/ }), -/***/ 24461: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ }), -"use strict"; +/***/ 77435: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.openPullRequest = void 0; -const logger_1 = __nccwpck_require__(58192); -const DEFAULT_PRIMARY = 'main'; -/** - * Create a GitHub PR on the upstream organization's repo - * Throws an error if the GitHub API fails - * @param {Octokit} octokit The authenticated octokit instance - * @param {RepoDomain} upstream The upstream repository - * @param {BranchDomain} origin The remote origin information that contains the origin branch - * @param {Description} description The pull request title and detailed description - * @param {boolean} maintainersCanModify Whether or not maintainers can modify the pull request. Default is true - * @param {string} upstreamPrimary The upstream repository's primary branch. Default is main. - * @param draft Open a DRAFT pull request. Defaults to false. - * @returns {Promise} - */ -async function openPullRequest(octokit, upstream, origin, description, maintainersCanModify = true, upstreamPrimary = DEFAULT_PRIMARY, draft = false) { - const head = `${origin.owner}:${origin.branch}`; - const existingPullRequest = (await octokit.pulls.list({ - owner: upstream.owner, - repo: origin.repo, - head, - })).data.find(pr => pr.head.label === head); - if (existingPullRequest) { - logger_1.logger.info(`Found existing pull request for reference ${origin.owner}:${origin.branch}. Skipping creating a new pull request.`); - return existingPullRequest.number; +const SemVer = __nccwpck_require__(31106) +const Range = __nccwpck_require__(85231) +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } } - const pullResponseData = (await octokit.pulls.create({ - owner: upstream.owner, - repo: origin.repo, - title: description.title, - head: `${origin.owner}:${origin.branch}`, - base: upstreamPrimary, - body: description.body, - maintainer_can_modify: maintainersCanModify, - draft: draft, - })).data; - logger_1.logger.info(`Successfully opened pull request available at url: ${pullResponseData.url}.`); - return pullResponseData.number; + }) + return min } -exports.openPullRequest = openPullRequest; -//# sourceMappingURL=open-pull-request.js.map +module.exports = minSatisfying + /***/ }), -/***/ 43102: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 29118: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const SemVer = __nccwpck_require__(31106) +const Range = __nccwpck_require__(85231) +const gt = __nccwpck_require__(45127) -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getPullRequestHunks = exports.getCurrentPullRequestPatches = exports.createPullRequestReview = exports.makeInlineSuggestions = exports.buildReviewComments = exports.buildSummaryComment = void 0; -const logger_1 = __nccwpck_require__(58192); -const diff_utils_1 = __nccwpck_require__(15276); -const hunk_utils_1 = __nccwpck_require__(26381); -function hunkErrorMessage(hunk) { - return ` * lines ${hunk.oldStart}-${hunk.oldEnd}`; -} -function fileErrorMessage(filename, hunks) { - return `* ${filename}\n` + hunks.map(hunkErrorMessage).join('\n'); -} -/** - * Build an error message based on invalid hunks. - * Returns an empty string if the provided hunks are empty. - * @param invalidHunks a map of filename to hunks that are not suggestable - */ -function buildSummaryComment(invalidHunks) { - if (invalidHunks.size === 0) { - return ''; - } - return ('Some suggestions could not be made:\n' + - Array.from(invalidHunks, ([filename, hunks]) => fileErrorMessage(filename, hunks)).join('\n')); -} -exports.buildSummaryComment = buildSummaryComment; -const COMFORT_PREVIEW_HEADER = 'application/vnd.github.comfort-fade-preview+json'; -/** - * Convert the patch suggestions into GitHub parameter objects. - * Use this to generate review comments - * For information see: - * https://developer.github.com/v3/pulls/comments/#create-a-review-comment-for-a-pull-request - * @param suggestions - */ -function buildReviewComments(suggestions) { - const fileComments = []; - suggestions.forEach((hunks, fileName) => { - hunks.forEach(hunk => { - const newContent = hunk.newContent.join('\n'); - if (hunk.oldStart === hunk.oldEnd) { - const singleComment = { - path: fileName, - body: `\`\`\`suggestion\n${newContent}\n\`\`\``, - line: hunk.oldEnd, - side: 'RIGHT', - }; - fileComments.push(singleComment); - } - else { - const comment = { - path: fileName, - body: `\`\`\`suggestion\n${newContent}\n\`\`\``, - start_line: hunk.oldStart, - line: hunk.oldEnd, - side: 'RIGHT', - start_side: 'RIGHT', - }; - fileComments.push(comment); - } - }); - }); - return fileComments; -} -exports.buildReviewComments = buildReviewComments; -/** - * Make a request to GitHub to make review comments - * @param octokit an authenticated octokit instance - * @param suggestions code suggestions patches - * @param remote the repository domain - * @param pullNumber the pull request number to make a review on - */ -async function makeInlineSuggestions(octokit, suggestions, outOfScopeSuggestions, remote, pullNumber) { - const comments = buildReviewComments(suggestions); - if (!comments.length) { - logger_1.logger.info('No valid suggestions to make'); - } - if (!comments.length && !outOfScopeSuggestions.size) { - logger_1.logger.info('No suggestions were generated. Exiting...'); - return null; - } - const summaryComment = buildSummaryComment(outOfScopeSuggestions); - if (summaryComment) { - logger_1.logger.warn('Some suggestions could not be made'); - } - // apply the suggestions to the latest sha - // the latest Pull Request hunk range includes - // all previous commit valid hunk ranges - const headSha = (await octokit.pulls.get({ - owner: remote.owner, - repo: remote.repo, - pull_number: pullNumber, - })).data.head.sha; - const reviewNumber = (await octokit.pulls.createReview({ - owner: remote.owner, - repo: remote.repo, - pull_number: pullNumber, - commit_id: headSha, - event: 'COMMENT', - body: summaryComment, - headers: { accept: COMFORT_PREVIEW_HEADER }, - // Octokit type definitions doesn't support mulitiline comments, but the GitHub API does - comments: comments, - })).data.id; - logger_1.logger.info(`Successfully created a review on pull request: ${pullNumber}.`); - return reviewNumber; -} -exports.makeInlineSuggestions = makeInlineSuggestions; -/** - * Comment on a Pull Request - * @param {Octokit} octokit authenticated octokit isntance - * @param {RepoDomain} remote the Pull Request repository - * @param {number} pullNumber the Pull Request number - * @param {number} pageSize the number of files to comment on // TODO pagination - * @param {Map} diffContents the old and new contents of the files to suggest - * @returns the created review's id, or null if no review was made - */ -async function createPullRequestReview(octokit, remote, pullNumber, pageSize, diffContents) { - try { - // get the hunks from the pull request - const pullRequestHunks = await exports.getPullRequestHunks(octokit, remote, pullNumber, pageSize); - // get the hunks from the suggested change - const allSuggestedHunks = typeof diffContents === 'string' - ? diff_utils_1.parseAllHunks(diffContents) - : hunk_utils_1.getRawSuggestionHunks(diffContents); - // split hunks by commentable and uncommentable - const { validHunks, invalidHunks } = hunk_utils_1.partitionSuggestedHunksByScope(pullRequestHunks, allSuggestedHunks); - // create pull request review - const reviewNumber = await exports.makeInlineSuggestions(octokit, validHunks, invalidHunks, remote, pullNumber); - return reviewNumber; - } - catch (err) { - logger_1.logger.error('Failed to suggest'); - throw err; - } -} -exports.createPullRequestReview = createPullRequestReview; -/** - * For a pull request, get each remote file's patch text asynchronously - * Also get the list of files whose patch data could not be returned - * @param {Octokit} octokit the authenticated octokit instance - * @param {RepoDomain} remote the remote repository domain information - * @param {number} pullNumber the pull request number - * @param {number} pageSize the number of results to return per page - * @returns {Promise>} the stringified patch data for each file and the list of files whose patch data could not be resolved - */ -async function getCurrentPullRequestPatches(octokit, remote, pullNumber, pageSize) { - // TODO: support pagination - const filesMissingPatch = []; - const files = (await octokit.pulls.listFiles({ - owner: remote.owner, - repo: remote.repo, - pull_number: pullNumber, - per_page: pageSize, - })).data; - const patches = new Map(); - if (files.length === 0) { - logger_1.logger.error(`0 file results have returned from list files query for Pull Request #${pullNumber}. Cannot make suggestions on an empty Pull Request`); - throw Error('Empty Pull Request'); - } - files.forEach(file => { - if (file.patch === undefined) { - // files whose patch is too large do not return the patch text by default - // TODO handle file patches that are too large - logger_1.logger.warn(`File ${file.filename} may have a patch that is too large to display patch object.`); - filesMissingPatch.push(file.filename); - } - else { - patches.set(file.filename, file.patch); - } - }); - if (patches.size === 0) { - logger_1.logger.warn('0 patches have been returned. This could be because the patch results were too large to return.'); - } - return { patches, filesMissingPatch }; -} -exports.getCurrentPullRequestPatches = getCurrentPullRequestPatches; -/** - * For a pull request, get each remote file's current patch range to identify the scope of each patch as a Map. - * @param {Octokit} octokit the authenticated octokit instance - * @param {RepoDomain} remote the remote repository domain information - * @param {number} pullNumber the pull request number - * @param {number} pageSize the number of files to return per pull request list files query - * @returns {Promise>} the scope of each file in the pull request - */ -async function getPullRequestHunks(octokit, remote, pullNumber, pageSize) { - const files = (await octokit.pulls.listFiles({ - owner: remote.owner, - repo: remote.repo, - pull_number: pullNumber, - per_page: pageSize, - })).data; - const pullRequestHunks = new Map(); - if (files.length === 0) { - logger_1.logger.error(`0 file results have returned from list files query for Pull Request #${pullNumber}. Cannot make suggestions on an empty Pull Request`); - throw Error('Empty Pull Request'); - } - files.forEach(file => { - if (file.patch === undefined) { - // files whose patch is too large do not return the patch text by default - // TODO handle file patches that are too large - logger_1.logger.warn(`File ${file.filename} may have a patch that is too large to display patch object.`); - } - else { - const hunks = diff_utils_1.parsePatch(file.patch); - pullRequestHunks.set(file.filename, hunks); - } - }); - if (pullRequestHunks.size === 0) { - logger_1.logger.warn('0 patches have been returned. This could be because the patch results were too large to return.'); - } - return pullRequestHunks; -} -exports.getPullRequestHunks = getPullRequestHunks; -//# sourceMappingURL=review-pull-request.js.map +const minVersion = (range, loose) => { + range = new Range(range, loose) -/***/ }), + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } -/***/ 77103: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } -"use strict"; + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseTextFiles = exports.createPullRequest = exports.reviewPullRequest = void 0; -const types_1 = __nccwpck_require__(13984); -const logger_1 = __nccwpck_require__(58192); -const default_options_handler_1 = __nccwpck_require__(9558); -const retry = __nccwpck_require__(33415); -const review_pull_request_1 = __nccwpck_require__(43102); -const branch_1 = __nccwpck_require__(58021); -const fork_1 = __nccwpck_require__(67386); -const commit_and_push_1 = __nccwpck_require__(4424); -const open_pull_request_1 = __nccwpck_require__(24461); -const labels_1 = __nccwpck_require__(8831); -/** - * Given a set of suggestions, make all the multiline inline review comments on a given pull request given - * that they are in scope of the pull request. Outof scope suggestions are not made. - * - * In-scope suggestions are specifically: the suggestion for a file must correspond to a file in the remote pull request - * and the diff hunk computed for a file's contents must produce a range that is a subset of the pull request's files hunks. - * - * If a file is too large to load in the review, it is skipped in the suggestion phase. - * - * If changes are empty then the workflow will not run. - * Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information. - * @param octokit The authenticated octokit instance, instantiated with an access token having permissiong to create a fork on the target repository. - * @param diffContents A set of changes. The changes may be empty. - * @param options The configuration for interacting with GitHub provided by the user. - * @returns the created review's id number, or null if there are no changes to be made. - */ -async function reviewPullRequest(octokit, diffContents, options) { - logger_1.setupLogger(options.logger); - // if null undefined, or the empty map then no changes have been provided. - // Do not execute GitHub workflow - if (diffContents === null || - diffContents === undefined || - (typeof diffContents !== 'string' && diffContents.size === 0)) { - logger_1.logger.info('Empty changes provided. No suggestions to be made. Cancelling workflow.'); - return null; - } - const gitHubConfigs = default_options_handler_1.addReviewCommentsDefaults(options); - const remote = { - owner: gitHubConfigs.owner, - repo: gitHubConfigs.repo, - }; - const reviewNumber = await review_pull_request_1.createPullRequestReview(octokit, remote, gitHubConfigs.pullNumber, gitHubConfigs.pageSize, diffContents); - return reviewNumber; -} -exports.reviewPullRequest = reviewPullRequest; -/** - * Make a new GitHub Pull Request with a set of changes applied on top of primary branch HEAD. - * The changes are committed into a new branch based on the upstream repository options using the authenticated Octokit account. - * Then a Pull Request is made from that branch. - * - * Also throws error if git data from the fork is not ready in 5 minutes. - * - * From the docs - * https://developer.github.com/v3/repos/forks/#create-a-fork - * """ - * Forking a Repository happens asynchronously. - * You may have to wait a short period of time before you can access the git objects. - * If this takes longer than 5 minutes, be sure to contact GitHub Support or GitHub Premium Support. - * """ - * - * If changes are empty then the workflow will not run. - * Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information. - * @param {Octokit} octokit The authenticated octokit instance, instantiated with an access token having permissiong to create a fork on the target repository - * @param {Changes | null | undefined} changes A set of changes. The changes may be empty - * @param {CreatePullRequestUserOptions} options The configuration for interacting with GitHub provided by the user. - * @returns {Promise} the pull request number. Returns 0 if unsuccessful. - */ -async function createPullRequest(octokit, changes, options) { - logger_1.setupLogger(options.logger); - // if null undefined, or the empty map then no changes have been provided. - // Do not execute GitHub workflow - if (changes === null || changes === undefined || changes.size === 0) { - logger_1.logger.info('Empty change set provided. No changes need to be made. Cancelling workflow.'); - return 0; - } - const gitHubConfigs = default_options_handler_1.addPullRequestDefaults(options); - logger_1.logger.info('Starting GitHub PR workflow...'); - const upstream = { - owner: gitHubConfigs.upstreamOwner, - repo: gitHubConfigs.upstreamRepo, - }; - const origin = options.fork === false ? upstream : await fork_1.fork(octokit, upstream); - const originBranch = { - ...origin, - branch: gitHubConfigs.branch, - }; - // The `retry` flag defaults to `5` to maintain compatibility - options.retry = options.retry === undefined ? 5 : options.retry; - const refHeadSha = await retry(async () => await branch_1.branch(octokit, origin, upstream, originBranch.branch, gitHubConfigs.primary), { - retries: options.retry, - factor: 2.8411, - minTimeout: 3000, - randomize: false, - onRetry: (e, attempt) => { - e.message = `Error creating Pull Request: ${e.message}`; - logger_1.logger.error(e); - logger_1.logger.info(`Retry attempt #${attempt}...`); - }, - }); - await commit_and_push_1.commitAndPush(octokit, refHeadSha, changes, originBranch, gitHubConfigs.message, gitHubConfigs.force); - const description = { - body: gitHubConfigs.description, - title: gitHubConfigs.title, - }; - const prNumber = await open_pull_request_1.openPullRequest(octokit, upstream, originBranch, description, gitHubConfigs.maintainersCanModify, gitHubConfigs.primary, options.draft); - logger_1.logger.info(`Successfully opened pull request: ${prNumber}.`); - // addLabels will no-op if options.labels is undefined or empty. - await labels_1.addLabels(octokit, upstream, originBranch, prNumber, options.labels); - return prNumber; -} -exports.createPullRequest = createPullRequest; -/** - * Convert a Map or {[path: string]: string}, where the key is the relative file path in the repository, - * and the value is the text content. The files will be converted to a Map also containing the file mode information '100644' - * @param {Object | Map} textFiles a map/object where the key is the relative file path and the value is the text file content - * @returns {Changes} Map of the file path to the string file content and the file mode '100644' - */ -function parseTextFiles(textFiles) { - const changes = new Map(); - if (textFiles instanceof Map) { - textFiles.forEach((content, path) => { - if (typeof path !== 'string' || - (content !== null && typeof content !== 'string')) { - throw TypeError('The file changeset provided must have a string key and a string/null value'); - } - changes.set(path, new types_1.FileData(content)); - }); - } - else { - for (const [path, content] of Object.entries(textFiles)) { - if (typeof path !== 'string' || - (content !== null && typeof content !== 'string')) { - throw TypeError('The file changeset provided must have a string key and a string/null value'); - } - changes.set(path, new types_1.FileData(content)); - } - } - return changes; + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) + minver = setMin + } + + if (minver && range.test(minver)) { + return minver + } + + return null } -exports.parseTextFiles = parseTextFiles; -//# sourceMappingURL=index.js.map +module.exports = minVersion + /***/ }), -/***/ 58192: -/***/ ((__unused_webpack_module, exports) => { +/***/ 22122: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const SemVer = __nccwpck_require__(31106) +const Comparator = __nccwpck_require__(59853) +const {ANY} = Comparator +const Range = __nccwpck_require__(85231) +const satisfies = __nccwpck_require__(65240) +const gt = __nccwpck_require__(45127) +const lt = __nccwpck_require__(7618) +const lte = __nccwpck_require__(74385) +const gte = __nccwpck_require__(22605) -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.setupLogger = exports.logger = void 0; -let logger; -exports.logger = logger; -class NullLogger { - constructor() { - this.error = () => { }; - this.warn = () => { }; - this.info = () => { }; - this.debug = () => { }; - this.trace = () => { }; - } -} -function setupLogger(userLogger) { - if (userLogger) { - exports.logger = logger = userLogger; - } - else { - exports.logger = logger = new NullLogger(); - } -} -exports.setupLogger = setupLogger; -//# sourceMappingURL=logger.js.map +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) -/***/ }), + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } -/***/ 13984: -/***/ ((__unused_webpack_module, exports) => { + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } -"use strict"; + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PatchSyntaxError = exports.FileData = void 0; -/** - * The content and the mode of a file. - * Default file mode is a text file which has code '100644'. - * If `content` is not null, then `content` must be the entire file content. - * See https://developer.github.com/v3/git/trees/#tree-object for details on mode. - */ -class FileData { - constructor(content, mode = '100644') { - this.mode = mode; - this.content = content; + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false } -} -exports.FileData = FileData; -class PatchSyntaxError extends Error { - constructor(message) { - super(message); - this.name = 'PatchSyntaxError'; + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false } + } + return true } -exports.PatchSyntaxError = PatchSyntaxError; -//# sourceMappingURL=types.js.map + +module.exports = outside + /***/ }), -/***/ 15276: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 78449: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = __nccwpck_require__(65240) +const compare = __nccwpck_require__(65857) +module.exports = (versions, range, options) => { + const set = [] + let min = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!min) + min = version + } else { + if (prev) { + set.push([min, prev]) + } + prev = null + min = null + } + } + if (min) + set.push([min, null]) -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getSuggestedHunks = exports.parseAllHunks = exports.parsePatch = void 0; -const parseDiff = __nccwpck_require__(94833); -const diff_1 = __nccwpck_require__(71672); -// This header is ignored for calculating patch ranges, but is neccessary -// for parsing a diff -const _DIFF_HEADER = `diff --git a/file.ext b/file.ext -index cac8fbc..87f387c 100644 ---- a/file.ext -+++ b/file.ext -`; -/** - * Given a patch expressed in GNU diff format, return the range of lines - * from the original content that are changed. - * @param diff Diff expressed in GNU diff format. - * @returns Hunk[] - */ -function parsePatch(patch) { - return parseAllHunks(_DIFF_HEADER + patch).get('file.ext') || []; -} -exports.parsePatch = parsePatch; -/** - * Given a diff expressed in GNU diff format, return the range of lines - * from the original content that are changed. - * @param diff Diff expressed in GNU diff format. - * @returns Map - */ -function parseAllHunks(diff) { - const hunksByFile = new Map(); - parseDiff(diff).forEach(file => { - const filename = file.to ? file.to : file.from; - const chunks = file.chunks.map(chunk => { - let oldStart = chunk.oldStart; - let newStart = chunk.newStart; - let normalLines = 0; - let changeSeen = false; - const newLines = []; - let previousLine = null; - let nextLine = null; - chunk.changes.forEach(change => { - // strip off leading '+', '-', or ' ' and trailing carriage return - const content = change.content.substring(1).replace(/[\n\r]+$/g, ''); - if (change.type === 'normal') { - normalLines++; - if (changeSeen) { - if (nextLine === null) { - nextLine = content; - } - } - else { - previousLine = content; - } - } - else { - if (change.type === 'add') { - // strip off leading '+' and trailing carriage return - newLines.push(content); - } - if (!changeSeen) { - oldStart += normalLines; - newStart += normalLines; - changeSeen = true; - } - } - }); - const newEnd = newStart + chunk.newLines - normalLines - 1; - const oldEnd = oldStart + chunk.oldLines - normalLines - 1; - let hunk = { - oldStart: oldStart, - oldEnd: oldEnd, - newStart: newStart, - newEnd: newEnd, - newContent: newLines, - }; - if (previousLine) { - hunk = { ...hunk, previousLine: previousLine }; - } - if (nextLine) { - hunk = { ...hunk, nextLine: nextLine }; - } - return hunk; - }); - hunksByFile.set(filename, chunks); - }); - return hunksByFile; -} -exports.parseAllHunks = parseAllHunks; -/** - * Given two texts, return the range of lines that are changed. - * @param oldContent The original content. - * @param newContent The new content. - * @returns Hunk[] - */ -function getSuggestedHunks(oldContent, newContent) { - const diff = diff_1.createPatch('unused', oldContent, newContent); - return parseAllHunks(diff).get('unused') || []; + const ranges = [] + for (const [min, max] of set) { + if (min === max) + ranges.push(min) + else if (!max && min === v[0]) + ranges.push('*') + else if (!max) + ranges.push(`>=${min}`) + else if (min === v[0]) + ranges.push(`<=${max}`) + else + ranges.push(`${min} - ${max}`) + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range } -exports.getSuggestedHunks = getSuggestedHunks; -//# sourceMappingURL=diff-utils.js.map + /***/ }), -/***/ 26381: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 44018: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const Range = __nccwpck_require__(85231) +const Comparator = __nccwpck_require__(59853) +const { ANY } = Comparator +const satisfies = __nccwpck_require__(65240) +const compare = __nccwpck_require__(65857) -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.partitionSuggestedHunksByScope = exports.getRawSuggestionHunks = exports.adjustHunkDown = exports.adjustHunkUp = void 0; -const diff_utils_1 = __nccwpck_require__(15276); -const logger_1 = __nccwpck_require__(58192); -/** - * Shift a Hunk up one line so it starts one line earlier. - * @param {Hunk} hunk - * @returns {Hunk | null} the adjusted Hunk or null if there is no preceeding line. - */ -function adjustHunkUp(hunk) { - if (!hunk.previousLine) { - return null; - } - return { - oldStart: hunk.oldStart - 1, - oldEnd: hunk.oldEnd, - newStart: hunk.newStart - 1, - newEnd: hunk.newEnd, - newContent: [hunk.previousLine, ...hunk.newContent], - }; -} -exports.adjustHunkUp = adjustHunkUp; -/** - * Shift a Hunk up one line so it ends one line later. - * @param {Hunk} hunk - * @returns {Hunk | null} the adjusted Hunk or null if there is no following line. - */ -function adjustHunkDown(hunk) { - if (!hunk.nextLine) { - return null; +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) + return true + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) + continue OUTER } - return { - oldStart: hunk.oldStart, - oldEnd: hunk.oldEnd + 1, - newStart: hunk.newStart, - newEnd: hunk.newEnd + 1, - newContent: hunk.newContent.concat(hunk.nextLine), - }; -} -exports.adjustHunkDown = adjustHunkDown; -/** - * Given a map where the key is the file name and the value is the - * old content and new content of the file - * compute the hunk for each file whose old and new contents differ. - * Do not compute the hunk if the old content is the same as the new content. - * The hunk list is sorted and each interval is disjoint. - * @param {Map} diffContents a map of the original file contents and the new file contents - * @returns the hunks for each file whose old and new contents differ - */ -function getRawSuggestionHunks(diffContents) { - const fileHunks = new Map(); - diffContents.forEach((fileDiffContent, fileName) => { - // if identical don't calculate the hunk and continue in the loop - if (fileDiffContent.oldContent === fileDiffContent.newContent) { - return; - } - const hunks = diff_utils_1.getSuggestedHunks(fileDiffContent.oldContent, fileDiffContent.newContent); - fileHunks.set(fileName, hunks); - }); - logger_1.logger.info('Parsed ranges of old and new patch'); - return fileHunks; -} -exports.getRawSuggestionHunks = getRawSuggestionHunks; -function hunkOverlaps(validHunk, suggestedHunk) { - return (suggestedHunk.oldStart >= validHunk.newStart && - suggestedHunk.oldEnd <= validHunk.newEnd); -} -function partitionFileHunks(pullRequestHunks, suggestedHunks) { - // check ranges: the entirety of the old range of the suggested - // hunk must fit inside the new range of the valid Hunks - let i = 0; - let candidateHunk = pullRequestHunks[i]; - const validFileHunks = []; - const invalidFileHunks = []; - suggestedHunks.forEach(suggestedHunk => { - while (candidateHunk && suggestedHunk.oldStart > candidateHunk.newEnd) { - i++; - candidateHunk = pullRequestHunks[i]; - } - if (!candidateHunk) { - invalidFileHunks.push(suggestedHunk); - return; - } - // if deletion only or addition only - if (suggestedHunk.newEnd < suggestedHunk.newStart || - suggestedHunk.oldEnd < suggestedHunk.oldStart) { - // try using previous line - let adjustedHunk = adjustHunkUp(suggestedHunk); - if (adjustedHunk && hunkOverlaps(candidateHunk, adjustedHunk)) { - validFileHunks.push(adjustedHunk); - return; - } - // try using next line - adjustedHunk = adjustHunkDown(suggestedHunk); - if (adjustedHunk && hunkOverlaps(candidateHunk, adjustedHunk)) { - validFileHunks.push(adjustedHunk); - return; - } - } - else if (hunkOverlaps(candidateHunk, suggestedHunk)) { - validFileHunks.push(suggestedHunk); - return; - } - invalidFileHunks.push(suggestedHunk); - }); - return { validFileHunks, invalidFileHunks }; -} -/** - * Split suggested hunks into commentable and non-commentable hunks. Compares the new line ranges - * from pullRequestHunks against the old line ranges from allSuggestedHunks. - * @param pullRequestHunks {Map} The parsed hunks from that represents the valid lines to comment. - * @param allSuggestedHunks {Map} The hunks that represent suggested changes. - * @returns {PartitionedHunks} split hunks - */ -function partitionSuggestedHunksByScope(pullRequestHunks, allSuggestedHunks) { - const validHunks = new Map(); - const invalidHunks = new Map(); - allSuggestedHunks.forEach((suggestedHunks, filename) => { - const pullRequestFileHunks = pullRequestHunks.get(filename); - if (!pullRequestFileHunks) { - // file is not the original PR - invalidHunks.set(filename, suggestedHunks); - return; - } - const { validFileHunks, invalidFileHunks } = partitionFileHunks(pullRequestFileHunks, suggestedHunks); - if (validFileHunks.length > 0) { - validHunks.set(filename, validFileHunks); - } - if (invalidFileHunks.length > 0) { - invalidHunks.set(filename, invalidFileHunks); - } - }); - return { validHunks, invalidHunks }; + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) + return false + } + return true } -exports.partitionSuggestedHunksByScope = partitionSuggestedHunksByScope; -//# sourceMappingURL=hunk-utils.js.map -/***/ }), +const simpleSubset = (sub, dom, options) => { + if (sub === dom) + return true -/***/ 97391: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) + return true + else if (options.includePrerelease) + sub = [ new Comparator('>=0.0.0-0') ] + else + sub = [ new Comparator('>=0.0.0') ] + } -/* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = __nccwpck_require__(78510); + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) + return true + else + dom = [ new Comparator('>=0.0.0') ] + } -// NOTE: conversions should only return primitive values (i.e. arrays, or -// values that give correct `typeof` results). -// do not use box values types (i.e. Number(), String(), etc.) + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') + gt = higherGT(gt, c, options) + else if (c.operator === '<' || c.operator === '<=') + lt = lowerLT(lt, c, options) + else + eqSet.add(c.semver) + } -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; -} + if (eqSet.size > 1) + return null -const convert = { - rgb: {channels: 3, labels: 'rgb'}, - hsl: {channels: 3, labels: 'hsl'}, - hsv: {channels: 3, labels: 'hsv'}, - hwb: {channels: 3, labels: 'hwb'}, - cmyk: {channels: 4, labels: 'cmyk'}, - xyz: {channels: 3, labels: 'xyz'}, - lab: {channels: 3, labels: 'lab'}, - lch: {channels: 3, labels: 'lch'}, - hex: {channels: 1, labels: ['hex']}, - keyword: {channels: 1, labels: ['keyword']}, - ansi16: {channels: 1, labels: ['ansi16']}, - ansi256: {channels: 1, labels: ['ansi256']}, - hcg: {channels: 3, labels: ['h', 'c', 'g']}, - apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, - gray: {channels: 1, labels: ['gray']} -}; + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) + return null + else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) + return null + } -module.exports = convert; + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) + return null -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } + if (lt && !satisfies(eq, String(lt), options)) + return null - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } + for (const c of dom) { + if (!satisfies(eq, String(c), options)) + return false + } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); - } + return true + } - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); -} + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } -convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) + return false + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) + return false + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) + return false + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) + return false + } + if (!c.operator && (lt || gt) && gtltComp !== 0) + return false + } - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) + return false - h = Math.min(h * 60, 360); + if (lt && hasDomGT && !gt && gtltComp !== 0) + return false - if (h < 0) { - h += 360; - } + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) + return false - const l = (min + max) / 2; + return true +} - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); - } +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) + return b + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} - return [h, s * 100, l * 100]; -}; +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) + return b + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} -convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; +module.exports = subset - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { - return (v - c) / 6 / diff + 1 / 2; - }; - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); +/***/ }), - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = (1 / 3) + rdif - bdif; - } else if (b === v) { - h = (2 / 3) + gdif - rdif; - } +/***/ 77948: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } +const Range = __nccwpck_require__(85231) - return [ - h * 360, - s * 100, - v * 100 - ]; -}; +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) -convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); +module.exports = toComparators - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - return [h, w * 100, b * 100]; -}; +/***/ }), -convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; +/***/ 59158: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; +const Range = __nccwpck_require__(85231) +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange - return [c * 100, m * 100, y * 100, k * 100]; -}; -function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ - return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) - ); -} +/***/ }), -convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } +/***/ 53961: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - let currentClosestDistance = Infinity; - let currentClosestKeyword; +"use strict"; - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - // Compute comparative distance - const distance = comparativeDistance(rgb, value); +const log = __nccwpck_require__(64314); - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } +class ValidationError extends Error { + constructor(prefix, message, ...rest) { + super(message); + this.name = "ValidationError"; + this.prefix = prefix; + log.resume(); // might be paused, noop otherwise + log.error(prefix, message, ...rest); + } +} - return currentClosestKeyword; -}; +module.exports.ValidationError = ValidationError; -convert.keyword.rgb = function (keyword) { - return cssKeywords[keyword]; -}; -convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; +/***/ }), - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); +/***/ 40334: +/***/ ((__unused_webpack_module, exports) => { - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); +"use strict"; - return [x * 100, y * 100, z * 100]; -}; -convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; +Object.defineProperty(exports, "__esModule", ({ value: true })); - x /= 95.047; - y /= 100; - z /= 108.883; +const REGEX_IS_INSTALLATION_LEGACY = /^v1\./; +const REGEX_IS_INSTALLATION = /^ghs_/; +const REGEX_IS_USER_TO_SERVER = /^ghu_/; +async function auth(token) { + const isApp = token.split(/\./).length === 3; + const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token); + const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token); + const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth"; + return { + type: "token", + token: token, + tokenType + }; +} - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); +/** + * Prefix token for usage in the Authorization header + * + * @param token OAuth token or JSON Web Token + */ +function withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) { + return `bearer ${token}`; + } - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); + return `token ${token}`; +} - return [l, a, b]; +async function hook(token, request, route, parameters) { + const endpoint = request.endpoint.merge(route, parameters); + endpoint.headers.authorization = withAuthorizationPrefix(token); + return request(endpoint); +} + +const createTokenAuth = function createTokenAuth(token) { + if (!token) { + throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); + } + + if (typeof token !== "string") { + throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); + } + + token = token.replace(/^(token|bearer) +/i, ""); + return Object.assign(auth.bind(null, token), { + hook: hook.bind(null, token) + }); }; -convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; +exports.createTokenAuth = createTokenAuth; +//# sourceMappingURL=index.js.map - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } +/***/ }), - const t1 = 2 * l - t2; +/***/ 76762: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } +"use strict"; - if (t3 > 1) { - t3--; - } - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - rgb[i] = val * 255; - } +var universalUserAgent = __nccwpck_require__(45030); +var beforeAfterHook = __nccwpck_require__(83682); +var request = __nccwpck_require__(36234); +var graphql = __nccwpck_require__(88467); +var authToken = __nccwpck_require__(40334); - return rgb; -}; +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; -convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } - l *= 2; - s *= (l <= 1) ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + return target; +} - return [h, sv * 100, v * 100]; -}; +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; -convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; + var target = _objectWithoutPropertiesLoose(source, excluded); - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); - v *= 255; + var key, i; - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } -}; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); -convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= (lmin <= 1) ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; + return target; +} - return [h, sl * 100, l * 100]; -}; +const VERSION = "3.5.1"; -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; +const _excluded = ["authStrategy"]; +class Octokit { + constructor(options = {}) { + const hook = new beforeAfterHook.Collection(); + const requestDefaults = { + baseUrl: request.request.endpoint.DEFAULTS.baseUrl, + headers: {}, + request: Object.assign({}, options.request, { + // @ts-ignore internal usage only, no need to type + hook: hook.bind(null, "request") + }), + mediaType: { + previews: [], + format: "" + } + }; // prepend default user agent with `options.userAgent` if set - // Wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } + requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; + if (options.baseUrl) { + requestDefaults.baseUrl = options.baseUrl; + } - if ((i & 0x01) !== 0) { - f = 1 - f; - } + if (options.previews) { + requestDefaults.mediaType.previews = options.previews; + } - const n = wh + f * (v - wh); // Linear interpolation + if (options.timeZone) { + requestDefaults.headers["time-zone"] = options.timeZone; + } - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - /* eslint-enable max-statements-per-line,no-multi-spaces */ - - return [r * 255, g * 255, b * 255]; -}; + this.request = request.request.defaults(requestDefaults); + this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults); + this.log = Object.assign({ + debug: () => {}, + info: () => {}, + warn: console.warn.bind(console), + error: console.error.bind(console) + }, options.log); + this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance + // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered. + // (2) If only `options.auth` is set, use the default token authentication strategy. + // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance. + // TODO: type `options.auth` based on `options.authStrategy`. -convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; + if (!options.authStrategy) { + if (!options.auth) { + // (1) + this.auth = async () => ({ + type: "unauthenticated" + }); + } else { + // (2) + const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); + hook.wrap("request", auth.hook); + this.auth = auth; + } + } else { + const { + authStrategy + } = options, + otherOptions = _objectWithoutProperties(options, _excluded); - return [r * 255, g * 255, b * 255]; -}; + const auth = authStrategy(Object.assign({ + request: this.request, + log: this.log, + // we pass the current octokit instance as well as its constructor options + // to allow for authentication strategies that return a new octokit instance + // that shares the same internal state as the current one. The original + // requirement for this was the "event-octokit" authentication strategy + // of https://github.com/probot/octokit-auth-probot. + octokit: this, + octokitOptions: otherOptions + }, options.auth)); // @ts-ignore ¯\_(ツ)_/¯ -convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; + hook.wrap("request", auth.hook); + this.auth = auth; + } // apply plugins + // https://stackoverflow.com/a/16345172 - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - // Assume sRGB - r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) - : r * 12.92; + const classConstructor = this.constructor; + classConstructor.plugins.forEach(plugin => { + Object.assign(this, plugin(this, options)); + }); + } - g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) - : g * 12.92; + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options = args[0] || {}; - b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) - : b * 12.92; + if (typeof defaults === "function") { + super(defaults(options)); + return; + } - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); + super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { + userAgent: `${options.userAgent} ${defaults.userAgent}` + } : null)); + } - return [r * 255, g * 255, b * 255]; -}; + }; + return OctokitWithDefaults; + } + /** + * Attach a plugin (or many) to your Octokit instance. + * + * @example + * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) + */ -convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - x /= 95.047; - y /= 100; - z /= 108.883; + static plugin(...newPlugins) { + var _a; - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); + const currentPlugins = this.plugins; + const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); + return NewOctokit; + } - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); +} +Octokit.VERSION = VERSION; +Octokit.plugins = []; - return [l, a, b]; -}; +exports.Octokit = Octokit; +//# sourceMappingURL=index.js.map -convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; +/***/ }), - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; +/***/ 59440: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - x *= 95.047; - y *= 100; - z *= 108.883; +"use strict"; - return [x, y, z]; -}; -convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; +Object.defineProperty(exports, "__esModule", ({ value: true })); - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; +var isPlainObject = __nccwpck_require__(63287); +var universalUserAgent = __nccwpck_require__(45030); - if (h < 0) { - h += 360; - } +function lowercaseKeys(object) { + if (!object) { + return {}; + } - const c = Math.sqrt(a * a + b * b); + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); +} - return [l, c, h]; -}; +function mergeDeep(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach(key => { + if (isPlainObject.isPlainObject(options[key])) { + if (!(key in defaults)) Object.assign(result, { + [key]: options[key] + });else result[key] = mergeDeep(defaults[key], options[key]); + } else { + Object.assign(result, { + [key]: options[key] + }); + } + }); + return result; +} -convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; +function removeUndefinedProperties(obj) { + for (const key in obj) { + if (obj[key] === undefined) { + delete obj[key]; + } + } - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); + return obj; +} - return [l, a, b]; -}; +function merge(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { + method, + url + } : { + url: method + }, options); + } else { + options = Object.assign({}, route); + } // lowercase header names before merging with defaults to avoid duplicates -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization - value = Math.round(value / 50); + options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging - if (value === 0) { - return 30; - } + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten - let ansi = 30 - + ((Math.round(b / 255) << 2) - | (Math.round(g / 255) << 1) - | Math.round(r / 255)); + if (defaults && defaults.mediaType.previews.length) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); + } - if (value === 2) { - ansi += 60; - } + mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); + return mergedOptions; +} - return ansi; -}; +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); -convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get - // it converted for us. - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); -}; + if (names.length === 0) { + return url; + } -convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; + return url + separator + names.map(name => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } - // We use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (r === g && g === b) { - if (r < 8) { - return 16; - } + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); +} - if (r > 248) { - return 231; - } +const urlVariableRegex = /\{[^}]+\}/g; - return Math.round(((r - 8) / 247) * 24) + 232; - } +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); +} - const ansi = 16 - + (36 * Math.round(r / 255 * 5)) - + (6 * Math.round(g / 255 * 5)) - + Math.round(b / 255 * 5); +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); - return ansi; -}; + if (!matches) { + return []; + } -convert.ansi16.rgb = function (args) { - let color = args % 10; + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); +} - // Handle greyscale - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } +function omit(object, keysToOmit) { + return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { + obj[key] = object[key]; + return obj; + }, {}); +} - color = color / 10.5 * 255; +// Based on https://github.com/bramstein/url-template, licensed under BSD +// TODO: create separate package. +// +// Copyright (c) 2012-2014, Bram Stein +// All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - return [color, color, color]; - } +/* istanbul ignore file */ +function encodeReserved(str) { + return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { + if (!/%[0-9A-Fa-f]/.test(part)) { + part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]"); + } - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; + return part; + }).join(""); +} - return [r, g, b]; -}; +function encodeUnreserved(str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return "%" + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} -convert.ansi256.rgb = function (args) { - // Handle greyscale - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } +function encodeValue(operator, value, key) { + value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); - args -= 16; + if (key) { + return encodeUnreserved(key) + "=" + value; + } else { + return value; + } +} - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; +function isDefined(value) { + return value !== undefined && value !== null; +} - return [r, g, b]; -}; +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} -convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) - + ((Math.round(args[1]) & 0xFF) << 8) - + (Math.round(args[2]) & 0xFF); +function getValues(context, operator, key, modifier) { + var value = context[key], + result = []; - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; + if (isDefined(value) && value !== "") { + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { + value = value.toString(); -convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } + if (modifier && modifier !== "*") { + value = value.substring(0, parseInt(modifier, 10)); + } - let colorString = match[0]; + result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function (value) { + result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : "")); + }); + } else { + Object.keys(value).forEach(function (k) { + if (isDefined(value[k])) { + result.push(encodeValue(operator, value[k], k)); + } + }); + } + } else { + const tmp = []; - if (match[0].length === 3) { - colorString = colorString.split('').map(char => { - return char + char; - }).join(''); - } + if (Array.isArray(value)) { + value.filter(isDefined).forEach(function (value) { + tmp.push(encodeValue(operator, value)); + }); + } else { + Object.keys(value).forEach(function (k) { + if (isDefined(value[k])) { + tmp.push(encodeUnreserved(k)); + tmp.push(encodeValue(operator, value[k].toString())); + } + }); + } - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; + if (isKeyOperator(operator)) { + result.push(encodeUnreserved(key) + "=" + tmp.join(",")); + } else if (tmp.length !== 0) { + result.push(tmp.join(",")); + } + } + } + } else { + if (operator === ";") { + if (isDefined(value)) { + result.push(encodeUnreserved(key)); + } + } else if (value === "" && (operator === "&" || operator === "?")) { + result.push(encodeUnreserved(key) + "="); + } else if (value === "") { + result.push(""); + } + } - return [r, g, b]; -}; + return result; +} -convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; +function parseUrl(template) { + return { + expand: expand.bind(null, template) + }; +} - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } +function expand(template, context) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) { + if (expression) { + let operator = ""; + const values = []; - if (chroma <= 0) { - hue = 0; - } else - if (max === r) { - hue = ((g - b) / chroma) % 6; - } else - if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - - hue /= 6; - hue %= 1; - - return [hue * 360, chroma * 100, grayscale * 100]; -}; - -convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; - - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - - let f = 0; - if (c < 1.0) { - f = (l - 0.5 * c) / (1.0 - c); - } - - return [hsl[0], c * 100, f * 100]; -}; - -convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; + if (operators.indexOf(expression.charAt(0)) !== -1) { + operator = expression.charAt(0); + expression = expression.substr(1); + } - const c = s * v; - let f = 0; + expression.split(/,/g).forEach(function (variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + }); - if (c < 1.0) { - f = (v - c) / (1 - c); - } + if (operator && operator !== "+") { + var separator = ","; - return [hsv[0], c * 100, f * 100]; -}; + if (operator === "?") { + separator = "&"; + } else if (operator !== "#") { + separator = operator; + } -convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; + return (values.length !== 0 ? operator : "") + values.join(separator); + } else { + return values.join(","); + } + } else { + return encodeReserved(literal); + } + }); +} - if (c === 0.0) { - return [g * 255, g * 255, g * 255]; - } +function parse(options) { + // https://fetch.spec.whatwg.org/#methods + let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; + let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{$1}"); + let headers = Object.assign({}, options.headers); + let body; + let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later - /* eslint-disable max-statements-per-line */ - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; pure[1] = v; pure[2] = 0; break; - case 1: - pure[0] = w; pure[1] = 1; pure[2] = 0; break; - case 2: - pure[0] = 0; pure[1] = 1; pure[2] = v; break; - case 3: - pure[0] = 0; pure[1] = w; pure[2] = 1; break; - case 4: - pure[0] = v; pure[1] = 0; pure[2] = 1; break; - default: - pure[0] = 1; pure[1] = 0; pure[2] = w; - } - /* eslint-enable max-statements-per-line */ + const urlVariableNames = extractUrlVariableNames(url); + url = parseUrl(url).expand(parameters); - mg = (1.0 - c) * g; + if (!/^http/.test(url)) { + url = options.baseUrl + url; + } - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; -}; + const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl"); + const remainingParameters = omit(parameters, omittedParameters); + const isBinaryRequest = /application\/octet-stream/i.test(headers.accept); -convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; + if (!isBinaryRequest) { + if (options.mediaType.format) { + // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw + headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(","); + } - const v = c + g * (1.0 - c); - let f = 0; + if (options.mediaType.previews.length) { + const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || []; + headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => { + const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; + return `application/vnd.github.${preview}-preview${format}`; + }).join(","); + } + } // for GET/HEAD requests, set URL query parameters from remaining parameters + // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters - if (v > 0.0) { - f = c / v; - } - return [hcg[0], f * 100, v * 100]; -}; + if (["GET", "HEAD"].includes(method)) { + url = addQueryParameters(url, remainingParameters); + } else { + if ("data" in remainingParameters) { + body = remainingParameters.data; + } else { + if (Object.keys(remainingParameters).length) { + body = remainingParameters; + } else { + headers["content-length"] = 0; + } + } + } // default content-type for JSON if body is set -convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; + if (!headers["content-type"] && typeof body !== "undefined") { + headers["content-type"] = "application/json; charset=utf-8"; + } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body. + // fetch does not allow to set `content-length` header, but we can set body to an empty string - if (l > 0.0 && l < 0.5) { - s = c / (2 * l); - } else - if (l >= 0.5 && l < 1.0) { - s = c / (2 * (1 - l)); - } - return [hcg[0], s * 100, l * 100]; -}; + if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { + body = ""; + } // Only return body/request keys if present -convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; -}; -convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; + return Object.assign({ + method, + url, + headers + }, typeof body !== "undefined" ? { + body + } : null, options.request ? { + request: options.request + } : null); +} - if (c < 1) { - g = (v - c) / (1 - c); - } +function endpointWithDefaults(defaults, route, options) { + return parse(merge(defaults, route, options)); +} - return [hwb[0], c * 100, g * 100]; -}; +function withDefaults(oldDefaults, newDefaults) { + const DEFAULTS = merge(oldDefaults, newDefaults); + const endpoint = endpointWithDefaults.bind(null, DEFAULTS); + return Object.assign(endpoint, { + DEFAULTS, + defaults: withDefaults.bind(null, DEFAULTS), + merge: merge.bind(null, DEFAULTS), + parse + }); +} -convert.apple.rgb = function (apple) { - return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; -}; +const VERSION = "6.0.12"; -convert.rgb.apple = function (rgb) { - return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; -}; +const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url. +// So we use RequestParameters and add method as additional required property. -convert.gray.rgb = function (args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +const DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent + }, + mediaType: { + format: "", + previews: [] + } }; -convert.gray.hsl = function (args) { - return [0, 0, args[0]]; -}; +const endpoint = withDefaults(null, DEFAULTS); -convert.gray.hsv = convert.gray.hsl; +exports.endpoint = endpoint; +//# sourceMappingURL=index.js.map -convert.gray.hwb = function (gray) { - return [0, 100, gray[0]]; -}; -convert.gray.cmyk = function (gray) { - return [0, 0, 0, gray[0]]; -}; +/***/ }), -convert.gray.lab = function (gray) { - return [gray[0], 0, 0]; -}; +/***/ 88467: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; +"use strict"; - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; -convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; -}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +var request = __nccwpck_require__(36234); +var universalUserAgent = __nccwpck_require__(45030); -/***/ }), +const VERSION = "4.8.0"; -/***/ 86931: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function _buildMessageForResponseErrors(data) { + return `Request failed due to following response errors:\n` + data.errors.map(e => ` - ${e.message}`).join("\n"); +} -const conversions = __nccwpck_require__(97391); -const route = __nccwpck_require__(30880); +class GraphqlResponseError extends Error { + constructor(request, headers, response) { + super(_buildMessageForResponseErrors(response)); + this.request = request; + this.headers = headers; + this.response = response; + this.name = "GraphqlResponseError"; // Expose the errors and response data in their shorthand properties. -const convert = {}; + this.errors = response.errors; + this.data = response.data; // Maintains proper stack trace (only available on V8) -const models = Object.keys(conversions); + /* istanbul ignore next */ -function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; - } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + } - if (arg0.length > 1) { - args = arg0; - } +} - return fn(args); - }; +const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query", "mediaType"]; +const FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; +const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; +function graphql(request, query, options) { + if (options) { + if (typeof query === "string" && "query" in options) { + return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); + } - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } + for (const key in options) { + if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue; + return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`)); + } + } - return wrappedFn; -} + const parsedOptions = typeof query === "string" ? Object.assign({ + query + }, options) : query; + const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { + if (NON_VARIABLE_OPTIONS.includes(key)) { + result[key] = parsedOptions[key]; + return result; + } -function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; + if (!result.variables) { + result.variables = {}; + } - if (arg0 === undefined || arg0 === null) { - return arg0; - } + result.variables[key] = parsedOptions[key]; + return result; + }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix + // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 - if (arg0.length > 1) { - args = arg0; - } + const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; - const result = fn(args); + if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { + requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); + } - // We're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } + return request(requestOptions).then(response => { + if (response.data.errors) { + const headers = {}; - return result; - }; + for (const key of Object.keys(response.headers)) { + headers[key] = response.headers[key]; + } - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } + throw new GraphqlResponseError(requestOptions, headers, response.data); + } - return wrappedFn; + return response.data.data; + }); } -models.forEach(fromModel => { - convert[fromModel] = {}; - - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); +function withDefaults(request$1, newDefaults) { + const newRequest = request$1.defaults(newDefaults); - const routes = route(fromModel); - const routeModels = Object.keys(routes); + const newApi = (query, options) => { + return graphql(newRequest, query, options); + }; - routeModels.forEach(toModel => { - const fn = routes[toModel]; + return Object.assign(newApi, { + defaults: withDefaults.bind(null, newRequest), + endpoint: request.request.endpoint + }); +} - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); +const graphql$1 = withDefaults(request.request, { + headers: { + "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}` + }, + method: "POST", + url: "/graphql" }); +function withCustomRequest(customRequest) { + return withDefaults(customRequest, { + method: "POST", + url: "/graphql" + }); +} -module.exports = convert; +exports.GraphqlResponseError = GraphqlResponseError; +exports.graphql = graphql$1; +exports.withCustomRequest = withCustomRequest; +//# sourceMappingURL=index.js.map /***/ }), -/***/ 30880: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const conversions = __nccwpck_require__(97391); +/***/ 64193: +/***/ ((__unused_webpack_module, exports) => { -/* - This function routes a model to all other models. +"use strict"; - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). - conversions that are not possible simply are not included. -*/ +Object.defineProperty(exports, "__esModule", ({ value: true })); -function buildGraph() { - const graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); +const VERSION = "2.17.0"; - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); - return graph; -} + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } - graph[fromModel].distance = 0; + keys.push.apply(keys, symbols); + } - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); + return keys; +} - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } - return graph; + return target; } -function link(from, to) { - return function (args) { - return to(from(args)); - }; +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; } -function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - - fn.conversion = path; - return fn; -} +/** + * Some “list” response that can be paginated have a different response structure + * + * They have a `total_count` key in the response (search also has `incomplete_results`, + * /installation/repositories also has `repository_selection`), as well as a key with + * the list of the items which name varies from endpoint to endpoint. + * + * Octokit normalizes these responses so that paginated results are always returned following + * the same structure. One challenge is that if the list response has only one page, no Link + * header is provided, so this header alone is not sufficient to check wether a response is + * paginated or not. + * + * We check if a "total_count" key is present in the response data, but also make sure that + * a "url" property is not, as the "Get the combined status for a specific ref" endpoint would + * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + */ +function normalizePaginatedListResponse(response) { + // endpoints can respond with 204 if repository is empty + if (!response.data) { + return _objectSpread2(_objectSpread2({}, response), {}, { + data: [] + }); + } -module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; + const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data); + if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way + // to retrieve the same information. - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; + const incompleteResults = response.data.incomplete_results; + const repositorySelection = response.data.repository_selection; + const totalCount = response.data.total_count; + delete response.data.incomplete_results; + delete response.data.repository_selection; + delete response.data.total_count; + const namespaceKey = Object.keys(response.data)[0]; + const data = response.data[namespaceKey]; + response.data = data; - if (node.parent === null) { - // No possible conversion, or this node is the source model. - continue; - } + if (typeof incompleteResults !== "undefined") { + response.data.incomplete_results = incompleteResults; + } - conversion[toModel] = wrapConversion(toModel, graph); - } + if (typeof repositorySelection !== "undefined") { + response.data.repository_selection = repositorySelection; + } - return conversion; -}; + response.data.total_count = totalCount; + return response; +} +function iterator(octokit, route, parameters) { + const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters); + const requestMethod = typeof route === "function" ? route : octokit.request; + const method = options.method; + const headers = options.headers; + let url = options.url; + return { + [Symbol.asyncIterator]: () => ({ + async next() { + if (!url) return { + done: true + }; + try { + const response = await requestMethod({ + method, + url, + headers + }); + const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format: + // '; rel="next", ; rel="last"' + // sets `url` to undefined if "next" URL is not present or `link` header is not set -/***/ }), + url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1]; + return { + value: normalizedResponse + }; + } catch (error) { + if (error.status !== 409) throw error; + url = ""; + return { + value: { + status: 200, + headers: {}, + data: [] + } + }; + } + } -/***/ 78510: -/***/ ((module) => { + }) + }; +} -"use strict"; - - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; +function paginate(octokit, route, parameters, mapFn) { + if (typeof parameters === "function") { + mapFn = parameters; + parameters = undefined; + } + return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn); +} -/***/ }), +function gather(octokit, results, iterator, mapFn) { + return iterator.next().then(result => { + if (result.done) { + return results; + } -/***/ 24623: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + let earlyExit = false; -"use strict"; + function done() { + earlyExit = true; + } -var arrayify = __nccwpck_require__(28912); -var dotPropGet = __nccwpck_require__(82042).get; + results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data); -function compareFunc(prop) { - return function(a, b) { - var ret = 0; + if (earlyExit) { + return results; + } - arrayify(prop).some(function(el) { - var x; - var y; + return gather(octokit, results, iterator, mapFn); + }); +} - if (typeof el === 'function') { - x = el(a); - y = el(b); - } else if (typeof el === 'string') { - x = dotPropGet(a, el); - y = dotPropGet(b, el); - } else { - x = a; - y = b; - } +const composePaginateRest = Object.assign(paginate, { + iterator +}); - if (x === y) { - ret = 0; - return; - } +const paginatingEndpoints = ["GET /app/hook/deliveries", "GET /app/installations", "GET /applications/grants", "GET /authorizations", "GET /enterprises/{enterprise}/actions/permissions/organizations", "GET /enterprises/{enterprise}/actions/runner-groups", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations", "GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners", "GET /enterprises/{enterprise}/actions/runners", "GET /enterprises/{enterprise}/actions/runners/downloads", "GET /events", "GET /gists", "GET /gists/public", "GET /gists/starred", "GET /gists/{gist_id}/comments", "GET /gists/{gist_id}/commits", "GET /gists/{gist_id}/forks", "GET /installation/repositories", "GET /issues", "GET /marketplace_listing/plans", "GET /marketplace_listing/plans/{plan_id}/accounts", "GET /marketplace_listing/stubbed/plans", "GET /marketplace_listing/stubbed/plans/{plan_id}/accounts", "GET /networks/{owner}/{repo}/events", "GET /notifications", "GET /organizations", "GET /orgs/{org}/actions/permissions/repositories", "GET /orgs/{org}/actions/runner-groups", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "GET /orgs/{org}/actions/runners", "GET /orgs/{org}/actions/runners/downloads", "GET /orgs/{org}/actions/secrets", "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", "GET /orgs/{org}/blocks", "GET /orgs/{org}/credential-authorizations", "GET /orgs/{org}/events", "GET /orgs/{org}/failed_invitations", "GET /orgs/{org}/hooks", "GET /orgs/{org}/hooks/{hook_id}/deliveries", "GET /orgs/{org}/installations", "GET /orgs/{org}/invitations", "GET /orgs/{org}/invitations/{invitation_id}/teams", "GET /orgs/{org}/issues", "GET /orgs/{org}/members", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/projects", "GET /orgs/{org}/public_members", "GET /orgs/{org}/repos", "GET /orgs/{org}/secret-scanning/alerts", "GET /orgs/{org}/team-sync/groups", "GET /orgs/{org}/teams", "GET /orgs/{org}/teams/{team_slug}/discussions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions", "GET /orgs/{org}/teams/{team_slug}/invitations", "GET /orgs/{org}/teams/{team_slug}/members", "GET /orgs/{org}/teams/{team_slug}/projects", "GET /orgs/{org}/teams/{team_slug}/repos", "GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings", "GET /orgs/{org}/teams/{team_slug}/teams", "GET /projects/columns/{column_id}/cards", "GET /projects/{project_id}/collaborators", "GET /projects/{project_id}/columns", "GET /repos/{owner}/{repo}/actions/artifacts", "GET /repos/{owner}/{repo}/actions/runners", "GET /repos/{owner}/{repo}/actions/runners/downloads", "GET /repos/{owner}/{repo}/actions/runs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", "GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs", "GET /repos/{owner}/{repo}/actions/secrets", "GET /repos/{owner}/{repo}/actions/workflows", "GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", "GET /repos/{owner}/{repo}/assignees", "GET /repos/{owner}/{repo}/autolinks", "GET /repos/{owner}/{repo}/branches", "GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations", "GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs", "GET /repos/{owner}/{repo}/code-scanning/alerts", "GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", "GET /repos/{owner}/{repo}/code-scanning/analyses", "GET /repos/{owner}/{repo}/collaborators", "GET /repos/{owner}/{repo}/comments", "GET /repos/{owner}/{repo}/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/commits", "GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head", "GET /repos/{owner}/{repo}/commits/{commit_sha}/comments", "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls", "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", "GET /repos/{owner}/{repo}/commits/{ref}/check-suites", "GET /repos/{owner}/{repo}/commits/{ref}/statuses", "GET /repos/{owner}/{repo}/contributors", "GET /repos/{owner}/{repo}/deployments", "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "GET /repos/{owner}/{repo}/events", "GET /repos/{owner}/{repo}/forks", "GET /repos/{owner}/{repo}/git/matching-refs/{ref}", "GET /repos/{owner}/{repo}/hooks", "GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries", "GET /repos/{owner}/{repo}/invitations", "GET /repos/{owner}/{repo}/issues", "GET /repos/{owner}/{repo}/issues/comments", "GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/issues/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/comments", "GET /repos/{owner}/{repo}/issues/{issue_number}/events", "GET /repos/{owner}/{repo}/issues/{issue_number}/labels", "GET /repos/{owner}/{repo}/issues/{issue_number}/reactions", "GET /repos/{owner}/{repo}/issues/{issue_number}/timeline", "GET /repos/{owner}/{repo}/keys", "GET /repos/{owner}/{repo}/labels", "GET /repos/{owner}/{repo}/milestones", "GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels", "GET /repos/{owner}/{repo}/notifications", "GET /repos/{owner}/{repo}/pages/builds", "GET /repos/{owner}/{repo}/projects", "GET /repos/{owner}/{repo}/pulls", "GET /repos/{owner}/{repo}/pulls/comments", "GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions", "GET /repos/{owner}/{repo}/pulls/{pull_number}/comments", "GET /repos/{owner}/{repo}/pulls/{pull_number}/commits", "GET /repos/{owner}/{repo}/pulls/{pull_number}/files", "GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews", "GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments", "GET /repos/{owner}/{repo}/releases", "GET /repos/{owner}/{repo}/releases/{release_id}/assets", "GET /repos/{owner}/{repo}/secret-scanning/alerts", "GET /repos/{owner}/{repo}/stargazers", "GET /repos/{owner}/{repo}/subscribers", "GET /repos/{owner}/{repo}/tags", "GET /repos/{owner}/{repo}/teams", "GET /repositories", "GET /repositories/{repository_id}/environments/{environment_name}/secrets", "GET /scim/v2/enterprises/{enterprise}/Groups", "GET /scim/v2/enterprises/{enterprise}/Users", "GET /scim/v2/organizations/{org}/Users", "GET /search/code", "GET /search/commits", "GET /search/issues", "GET /search/labels", "GET /search/repositories", "GET /search/topics", "GET /search/users", "GET /teams/{team_id}/discussions", "GET /teams/{team_id}/discussions/{discussion_number}/comments", "GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions", "GET /teams/{team_id}/discussions/{discussion_number}/reactions", "GET /teams/{team_id}/invitations", "GET /teams/{team_id}/members", "GET /teams/{team_id}/projects", "GET /teams/{team_id}/repos", "GET /teams/{team_id}/team-sync/group-mappings", "GET /teams/{team_id}/teams", "GET /user/blocks", "GET /user/emails", "GET /user/followers", "GET /user/following", "GET /user/gpg_keys", "GET /user/installations", "GET /user/installations/{installation_id}/repositories", "GET /user/issues", "GET /user/keys", "GET /user/marketplace_purchases", "GET /user/marketplace_purchases/stubbed", "GET /user/memberships/orgs", "GET /user/migrations", "GET /user/migrations/{migration_id}/repositories", "GET /user/orgs", "GET /user/packages", "GET /user/public_emails", "GET /user/repos", "GET /user/repository_invitations", "GET /user/starred", "GET /user/subscriptions", "GET /user/teams", "GET /users", "GET /users/{username}/events", "GET /users/{username}/events/orgs/{org}", "GET /users/{username}/events/public", "GET /users/{username}/followers", "GET /users/{username}/following", "GET /users/{username}/gists", "GET /users/{username}/gpg_keys", "GET /users/{username}/keys", "GET /users/{username}/orgs", "GET /users/{username}/packages", "GET /users/{username}/projects", "GET /users/{username}/received_events", "GET /users/{username}/received_events/public", "GET /users/{username}/repos", "GET /users/{username}/starred", "GET /users/{username}/subscriptions"]; - if (typeof x === 'string' && typeof y === 'string') { - ret = x.localeCompare(y); - return ret !== 0; - } +function isPaginatingEndpoint(arg) { + if (typeof arg === "string") { + return paginatingEndpoints.includes(arg); + } else { + return false; + } +} - ret = x < y ? -1 : 1; - return true; - }); +/** + * @param octokit Octokit instance + * @param options Options passed to Octokit constructor + */ - return ret; +function paginateRest(octokit) { + return { + paginate: Object.assign(paginate.bind(null, octokit), { + iterator: iterator.bind(null, octokit) + }) }; } +paginateRest.VERSION = VERSION; -module.exports = compareFunc; +exports.composePaginateRest = composePaginateRest; +exports.isPaginatingEndpoint = isPaginatingEndpoint; +exports.paginateRest = paginateRest; +exports.paginatingEndpoints = paginatingEndpoints; +//# sourceMappingURL=index.js.map /***/ }), -/***/ 73645: +/***/ 68883: /***/ ((__unused_webpack_module, exports) => { "use strict"; -// These tables borrowed from `ansi` +Object.defineProperty(exports, "__esModule", ({ value: true })); -var prefix = '\x1b[' +const VERSION = "1.0.4"; -exports.up = function up (num) { - return prefix + (num || '') + 'A' -} +/** + * @param octokit Octokit instance + * @param options Options passed to Octokit constructor + */ -exports.down = function down (num) { - return prefix + (num || '') + 'B' +function requestLog(octokit) { + octokit.hook.wrap("request", (request, options) => { + octokit.log.debug("request", options); + const start = Date.now(); + const requestOptions = octokit.request.endpoint.parse(options); + const path = requestOptions.url.replace(options.baseUrl, ""); + return request(options).then(response => { + octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`); + return response; + }).catch(error => { + octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`); + throw error; + }); + }); } +requestLog.VERSION = VERSION; -exports.forward = function forward (num) { - return prefix + (num || '') + 'C' -} +exports.requestLog = requestLog; +//# sourceMappingURL=index.js.map -exports.back = function back (num) { - return prefix + (num || '') + 'D' -} -exports.nextLine = function nextLine (num) { - return prefix + (num || '') + 'E' -} +/***/ }), -exports.previousLine = function previousLine (num) { - return prefix + (num || '') + 'F' -} +/***/ 83044: +/***/ ((__unused_webpack_module, exports) => { -exports.horizontalAbsolute = function horizontalAbsolute (num) { - if (num == null) throw new Error('horizontalAboslute requires a column to position to') - return prefix + num + 'G' -} +"use strict"; -exports.eraseData = function eraseData () { - return prefix + 'J' -} -exports.eraseLine = function eraseLine () { - return prefix + 'K' -} +Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.goto = function (x, y) { - return prefix + y + ';' + x + 'H' -} +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); -exports.gotoSOL = function () { - return '\r' -} + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); -exports.beep = function () { - return '\x07' -} + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } -exports.hideCursor = function hideCursor () { - return prefix + '?25l' -} + keys.push.apply(keys, symbols); + } -exports.showCursor = function showCursor () { - return prefix + '?25h' + return keys; } -var colors = { - reset: 0, -// styles - bold: 1, - italic: 3, - underline: 4, - inverse: 7, -// resets - stopBold: 22, - stopItalic: 23, - stopUnderline: 24, - stopInverse: 27, -// colors - white: 37, - black: 30, - blue: 34, - cyan: 36, - green: 32, - magenta: 35, - red: 31, - yellow: 33, - bgWhite: 47, - bgBlack: 40, - bgBlue: 44, - bgCyan: 46, - bgGreen: 42, - bgMagenta: 45, - bgRed: 41, - bgYellow: 43, - - grey: 90, - brightBlack: 90, - brightRed: 91, - brightGreen: 92, - brightYellow: 93, - brightBlue: 94, - brightMagenta: 95, - brightCyan: 96, - brightWhite: 97, - - bgGrey: 100, - bgBrightBlack: 100, - bgBrightRed: 101, - bgBrightGreen: 102, - bgBrightYellow: 103, - bgBrightBlue: 104, - bgBrightMagenta: 105, - bgBrightCyan: 106, - bgBrightWhite: 107 -} +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; -exports.color = function color (colorWith) { - if (arguments.length !== 1 || !Array.isArray(colorWith)) { - colorWith = Array.prototype.slice.call(arguments) + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } } - return prefix + colorWith.map(colorNameToCode).join(';') + 'm' -} -function colorNameToCode (color) { - if (colors[color] != null) return colors[color] - throw new Error('Unknown color or style name: ' + color) + return target; } - -/***/ }), - -/***/ 82429: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const { breakingHeaderPattern } = __nccwpck_require__(88236)() - -module.exports = (commit) => { - const match = commit.header.match(breakingHeaderPattern) - if (match && commit.notes.length === 0) { - const noteText = match[3] // the description of the change. - commit.notes.push({ - text: noteText - }) - } -} - - -/***/ }), - -/***/ 87333: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const Q = __nccwpck_require__(56172) -const parserOpts = __nccwpck_require__(88236) -const writerOpts = __nccwpck_require__(10382) - -module.exports = function (config) { - return Q.all([parserOpts(config), writerOpts(config)]) - .spread((parserOpts, writerOpts) => { - return { parserOpts, writerOpts } - }) -} - - -/***/ }), - -/***/ 97620: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const addBangNotes = __nccwpck_require__(82429) -const parserOpts = __nccwpck_require__(88236) - -module.exports = function (config) { - return { - parserOpts: parserOpts(config), - - whatBump: (commits) => { - let level = 2 - let breakings = 0 - let features = 0 - - commits.forEach(commit => { - // adds additional breaking change notes - // for the special case, test(system)!: hello world, where there is - // a '!' but no 'BREAKING CHANGE' in body: - addBangNotes(commit) - if (commit.notes.length > 0) { - breakings += commit.notes.length - level = 0 - } else if (commit.type === 'feat' || commit.type === 'feature') { - features += 1 - if (level === 2) { - level = 1 - } - } - }) - - if (config.preMajor && level < 2) { - level++ - } - - return { - level: level, - reason: breakings === 1 - ? `There is ${breakings} BREAKING CHANGE and ${features} features` - : `There are ${breakings} BREAKING CHANGES and ${features} features` - } - } - } -} - - -/***/ }), - -/***/ 88761: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const Q = __nccwpck_require__(56172) -const _ = __nccwpck_require__(90250) -const conventionalChangelog = __nccwpck_require__(87333) -const parserOpts = __nccwpck_require__(88236) -const recommendedBumpOpts = __nccwpck_require__(97620) -const writerOpts = __nccwpck_require__(10382) - -module.exports = function (parameter) { - // parameter passed can be either a config object or a callback function - if (_.isFunction(parameter)) { - // parameter is a callback object - const config = {} - // FIXME: use presetOpts(config) for callback - Q.all([ - conventionalChangelog(config), - parserOpts(config), - recommendedBumpOpts(config), - writerOpts(config) - ]).spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { - parameter(null, { gitRawCommitsOpts: { noMerges: null }, conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts }) - }) +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); } else { - const config = parameter || {} - return presetOpts(config) - } -} - -function presetOpts (config) { - return Q.all([ - conventionalChangelog(config), - parserOpts(config), - recommendedBumpOpts(config), - writerOpts(config) - ]).spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { - return { conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts } - }) -} - - -/***/ }), - -/***/ 88236: -/***/ ((module) => { - -"use strict"; - - -module.exports = function (config) { - config = defaultConfig(config) - return { - headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/, - breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/, - headerCorrespondence: [ - 'type', - 'scope', - 'subject' - ], - noteKeywords: ['BREAKING CHANGE'], - revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i, - revertCorrespondence: ['header', 'hash'], - issuePrefixes: config.issuePrefixes + obj[key] = value; } -} - -// merge user set configuration with default configuration. -function defaultConfig (config) { - config = config || {} - config.issuePrefixes = config.issuePrefixes || ['#'] - return config -} - - -/***/ }), - -/***/ 10382: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const addBangNotes = __nccwpck_require__(82429) -const compareFunc = __nccwpck_require__(24623) -const Q = __nccwpck_require__(56172) -const readFile = Q.denodeify(__nccwpck_require__(35747).readFile) -const resolve = __nccwpck_require__(85622).resolve -const releaseAsRe = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i - -/** - * Handlebar partials for various property substitutions based on commit context. - */ -const owner = '{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}' -const host = '{{~@root.host}}' -const repository = '{{#if this.repository}}{{~this.repository}}{{else}}{{~@root.repository}}{{/if}}' - -module.exports = function (config) { - config = defaultConfig(config) - const commitUrlFormat = expandTemplate(config.commitUrlFormat, { - host, - owner, - repository - }) - const compareUrlFormat = expandTemplate(config.compareUrlFormat, { - host, - owner, - repository - }) - const issueUrlFormat = expandTemplate(config.issueUrlFormat, { - host, - owner, - repository, - id: '{{this.issue}}', - prefix: '{{this.prefix}}' - }) - - return Q.all([ - readFile(__nccwpck_require__.ab + "template2.hbs", 'utf-8'), - readFile(__nccwpck_require__.ab + "header2.hbs", 'utf-8'), - readFile(__nccwpck_require__.ab + "commit2.hbs", 'utf-8'), - readFile(__nccwpck_require__.ab + "footer1.hbs", 'utf-8') - ]) - .spread((template, header, commit, footer) => { - const writerOpts = getWriterOpts(config) - writerOpts.mainTemplate = template - writerOpts.headerPartial = header - .replace(/{{compareUrlFormat}}/g, compareUrlFormat) - writerOpts.commitPartial = commit - .replace(/{{commitUrlFormat}}/g, commitUrlFormat) - .replace(/{{issueUrlFormat}}/g, issueUrlFormat) - writerOpts.footerPartial = footer - - return writerOpts - }) -} - -function findTypeEntry (types, commit) { - const typeKey = (commit.revert ? 'revert' : (commit.type || '')).toLowerCase() - return types.find((entry) => { - if (entry.type !== typeKey) { - return false - } - if (entry.scope && entry.scope !== commit.scope) { - return false - } - return true - }) + return obj; } -function getWriterOpts (config) { - config = defaultConfig(config) - - return { - transform: (commit, context) => { - let discard = true - const issues = [] - const entry = findTypeEntry(config.types, commit) - - // adds additional breaking change notes - // for the special case, test(system)!: hello world, where there is - // a '!' but no 'BREAKING CHANGE' in body: - addBangNotes(commit) - - // Add an entry in the CHANGELOG if special Release-As footer - // is used: - if ((commit.footer && releaseAsRe.test(commit.footer)) || - (commit.body && releaseAsRe.test(commit.body))) { - discard = false - } - - commit.notes.forEach(note => { - note.title = 'BREAKING CHANGES' - discard = false - }) - - // breaking changes attached to any type are still displayed. - if (discard && (entry === undefined || - entry.hidden)) return - - if (entry) commit.type = entry.section - - if (commit.scope === '*') { - commit.scope = '' +const Endpoints = { + actions: { + addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + approveWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"], + cancelWorkflowRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"], + createOrUpdateEnvironmentSecret: ["PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + createRegistrationTokenForOrg: ["POST /orgs/{org}/actions/runners/registration-token"], + createRegistrationTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/registration-token"], + createRemoveTokenForOrg: ["POST /orgs/{org}/actions/runners/remove-token"], + createRemoveTokenForRepo: ["POST /repos/{owner}/{repo}/actions/runners/remove-token"], + createWorkflowDispatch: ["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"], + deleteArtifact: ["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + deleteEnvironmentSecret: ["DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + deleteOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + deleteSelfHostedRunnerFromOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}"], + deleteSelfHostedRunnerFromRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"], + deleteWorkflowRun: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"], + deleteWorkflowRunLogs: ["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + disableSelectedRepositoryGithubActionsOrganization: ["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"], + disableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"], + downloadArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"], + downloadJobLogsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"], + downloadWorkflowRunAttemptLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"], + downloadWorkflowRunLogs: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"], + enableSelectedRepositoryGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"], + enableWorkflow: ["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"], + getAllowedActionsOrganization: ["GET /orgs/{org}/actions/permissions/selected-actions"], + getAllowedActionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"], + getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getEnvironmentPublicKey: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key"], + getEnvironmentSecret: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}"], + getGithubActionsPermissionsOrganization: ["GET /orgs/{org}/actions/permissions"], + getGithubActionsPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions"], + getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], + getOrgPublicKey: ["GET /orgs/{org}/actions/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}"], + getPendingDeploymentsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], + getRepoPermissions: ["GET /repos/{owner}/{repo}/actions/permissions", {}, { + renamed: ["actions", "getGithubActionsPermissionsRepository"] + }], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/actions/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"], + getReviewsForRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"], + getSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}"], + getSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"], + getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"], + getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"], + getWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"], + getWorkflowRunUsage: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"], + getWorkflowUsage: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"], + listArtifactsForRepo: ["GET /repos/{owner}/{repo}/actions/artifacts"], + listEnvironmentSecrets: ["GET /repositories/{repository_id}/environments/{environment_name}/secrets"], + listJobsForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"], + listJobsForWorkflowRunAttempt: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"], + listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], + listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], + listRunnerApplicationsForOrg: ["GET /orgs/{org}/actions/runners/downloads"], + listRunnerApplicationsForRepo: ["GET /repos/{owner}/{repo}/actions/runners/downloads"], + listSelectedReposForOrgSecret: ["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"], + listSelectedRepositoriesEnabledGithubActionsOrganization: ["GET /orgs/{org}/actions/permissions/repositories"], + listSelfHostedRunnersForOrg: ["GET /orgs/{org}/actions/runners"], + listSelfHostedRunnersForRepo: ["GET /repos/{owner}/{repo}/actions/runners"], + listWorkflowRunArtifacts: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"], + listWorkflowRuns: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"], + listWorkflowRunsForRepo: ["GET /repos/{owner}/{repo}/actions/runs"], + removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"], + reviewPendingDeploymentsForRun: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"], + setAllowedActionsOrganization: ["PUT /orgs/{org}/actions/permissions/selected-actions"], + setAllowedActionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"], + setGithubActionsPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions"], + setGithubActionsPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"], + setSelectedRepositoriesEnabledGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories"] + }, + activity: { + checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], + deleteRepoSubscription: ["DELETE /repos/{owner}/{repo}/subscription"], + deleteThreadSubscription: ["DELETE /notifications/threads/{thread_id}/subscription"], + getFeeds: ["GET /feeds"], + getRepoSubscription: ["GET /repos/{owner}/{repo}/subscription"], + getThread: ["GET /notifications/threads/{thread_id}"], + getThreadSubscriptionForAuthenticatedUser: ["GET /notifications/threads/{thread_id}/subscription"], + listEventsForAuthenticatedUser: ["GET /users/{username}/events"], + listNotificationsForAuthenticatedUser: ["GET /notifications"], + listOrgEventsForAuthenticatedUser: ["GET /users/{username}/events/orgs/{org}"], + listPublicEvents: ["GET /events"], + listPublicEventsForRepoNetwork: ["GET /networks/{owner}/{repo}/events"], + listPublicEventsForUser: ["GET /users/{username}/events/public"], + listPublicOrgEvents: ["GET /orgs/{org}/events"], + listReceivedEventsForUser: ["GET /users/{username}/received_events"], + listReceivedPublicEventsForUser: ["GET /users/{username}/received_events/public"], + listRepoEvents: ["GET /repos/{owner}/{repo}/events"], + listRepoNotificationsForAuthenticatedUser: ["GET /repos/{owner}/{repo}/notifications"], + listReposStarredByAuthenticatedUser: ["GET /user/starred"], + listReposStarredByUser: ["GET /users/{username}/starred"], + listReposWatchedByUser: ["GET /users/{username}/subscriptions"], + listStargazersForRepo: ["GET /repos/{owner}/{repo}/stargazers"], + listWatchedReposForAuthenticatedUser: ["GET /user/subscriptions"], + listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], + markNotificationsAsRead: ["PUT /notifications"], + markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], + setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], + setThreadSubscription: ["PUT /notifications/threads/{thread_id}/subscription"], + starRepoForAuthenticatedUser: ["PUT /user/starred/{owner}/{repo}"], + unstarRepoForAuthenticatedUser: ["DELETE /user/starred/{owner}/{repo}"] + }, + apps: { + addRepoToInstallation: ["PUT /user/installations/{installation_id}/repositories/{repository_id}", {}, { + renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] + }], + addRepoToInstallationForAuthenticatedUser: ["PUT /user/installations/{installation_id}/repositories/{repository_id}"], + checkToken: ["POST /applications/{client_id}/token"], + createContentAttachment: ["POST /content_references/{content_reference_id}/attachments", { + mediaType: { + previews: ["corsair"] } - - if (typeof commit.hash === 'string') { - commit.shortHash = commit.hash.substring(0, 7) + }], + createContentAttachmentForRepo: ["POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", { + mediaType: { + previews: ["corsair"] } - - if (typeof commit.subject === 'string') { - // Issue URLs. - config.issuePrefixes.join('|') - const issueRegEx = '(' + config.issuePrefixes.join('|') + ')' + '([0-9]+)' - const re = new RegExp(issueRegEx, 'g') - - commit.subject = commit.subject.replace(re, (_, prefix, issue) => { - issues.push(prefix + issue) - const url = expandTemplate(config.issueUrlFormat, { - host: context.host, - owner: context.owner, - repository: context.repository, - id: issue, - prefix: prefix - }) - return `[${prefix}${issue}](${url})` - }) - // User URLs. - commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, user) => { - // TODO: investigate why this code exists. - if (user.includes('/')) { - return `@${user}` - } - - const usernameUrl = expandTemplate(config.userUrlFormat, { - host: context.host, - owner: context.owner, - repository: context.repository, - user: user - }) - - return `[@${user}](${usernameUrl})` - }) + }], + createFromManifest: ["POST /app-manifests/{code}/conversions"], + createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], + deleteAuthorization: ["DELETE /applications/{client_id}/grant"], + deleteInstallation: ["DELETE /app/installations/{installation_id}"], + deleteToken: ["DELETE /applications/{client_id}/token"], + getAuthenticated: ["GET /app"], + getBySlug: ["GET /apps/{app_slug}"], + getInstallation: ["GET /app/installations/{installation_id}"], + getOrgInstallation: ["GET /orgs/{org}/installation"], + getRepoInstallation: ["GET /repos/{owner}/{repo}/installation"], + getSubscriptionPlanForAccount: ["GET /marketplace_listing/accounts/{account_id}"], + getSubscriptionPlanForAccountStubbed: ["GET /marketplace_listing/stubbed/accounts/{account_id}"], + getUserInstallation: ["GET /users/{username}/installation"], + getWebhookConfigForApp: ["GET /app/hook/config"], + getWebhookDelivery: ["GET /app/hook/deliveries/{delivery_id}"], + listAccountsForPlan: ["GET /marketplace_listing/plans/{plan_id}/accounts"], + listAccountsForPlanStubbed: ["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"], + listInstallationReposForAuthenticatedUser: ["GET /user/installations/{installation_id}/repositories"], + listInstallations: ["GET /app/installations"], + listInstallationsForAuthenticatedUser: ["GET /user/installations"], + listPlans: ["GET /marketplace_listing/plans"], + listPlansStubbed: ["GET /marketplace_listing/stubbed/plans"], + listReposAccessibleToInstallation: ["GET /installation/repositories"], + listSubscriptionsForAuthenticatedUser: ["GET /user/marketplace_purchases"], + listSubscriptionsForAuthenticatedUserStubbed: ["GET /user/marketplace_purchases/stubbed"], + listWebhookDeliveries: ["GET /app/hook/deliveries"], + redeliverWebhookDelivery: ["POST /app/hook/deliveries/{delivery_id}/attempts"], + removeRepoFromInstallation: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}", {}, { + renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] + }], + removeRepoFromInstallationForAuthenticatedUser: ["DELETE /user/installations/{installation_id}/repositories/{repository_id}"], + resetToken: ["PATCH /applications/{client_id}/token"], + revokeInstallationAccessToken: ["DELETE /installation/token"], + scopeToken: ["POST /applications/{client_id}/token/scoped"], + suspendInstallation: ["PUT /app/installations/{installation_id}/suspended"], + unsuspendInstallation: ["DELETE /app/installations/{installation_id}/suspended"], + updateWebhookConfigForApp: ["PATCH /app/hook/config"] + }, + billing: { + getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], + getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], + getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], + getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], + getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], + getSharedStorageBillingUser: ["GET /users/{username}/settings/billing/shared-storage"] + }, + checks: { + create: ["POST /repos/{owner}/{repo}/check-runs"], + createSuite: ["POST /repos/{owner}/{repo}/check-suites"], + get: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"], + getSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"], + listAnnotations: ["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"], + listForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"], + listForSuite: ["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"], + listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"], + rerequestRun: ["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"], + rerequestSuite: ["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"], + setSuitesPreferences: ["PATCH /repos/{owner}/{repo}/check-suites/preferences"], + update: ["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"] + }, + codeScanning: { + deleteAnalysis: ["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"], + getAlert: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", {}, { + renamedParameters: { + alert_id: "alert_number" } - - // remove references that already appear in the subject - commit.references = commit.references.filter(reference => { - if (issues.indexOf(reference.prefix + reference.issue) === -1) { - return true - } - - return false - }) - - return commit - }, - groupBy: 'type', - // the groupings of commit messages, e.g., Features vs., Bug Fixes, are - // sorted based on their probable importance: - commitGroupsSort: (a, b) => { - const commitGroupOrder = ['Reverts', 'Performance Improvements', 'Bug Fixes', 'Features'] - const gRankA = commitGroupOrder.indexOf(a.title) - const gRankB = commitGroupOrder.indexOf(b.title) - if (gRankA >= gRankB) { - return -1 - } else { - return 1 - } - }, - commitsSort: ['scope', 'subject'], - noteGroupsSort: 'title', - notesSort: compareFunc - } -} - -// merge user set configuration with default configuration. -function defaultConfig (config) { - config = config || {} - config.types = config.types || [ - { type: 'feat', section: 'Features' }, - { type: 'feature', section: 'Features' }, - { type: 'fix', section: 'Bug Fixes' }, - { type: 'perf', section: 'Performance Improvements' }, - { type: 'revert', section: 'Reverts' }, - { type: 'docs', section: 'Documentation', hidden: true }, - { type: 'style', section: 'Styles', hidden: true }, - { type: 'chore', section: 'Miscellaneous Chores', hidden: true }, - { type: 'refactor', section: 'Code Refactoring', hidden: true }, - { type: 'test', section: 'Tests', hidden: true }, - { type: 'build', section: 'Build System', hidden: true }, - { type: 'ci', section: 'Continuous Integration', hidden: true } - ] - config.issueUrlFormat = config.issueUrlFormat || - '{{host}}/{{owner}}/{{repository}}/issues/{{id}}' - config.commitUrlFormat = config.commitUrlFormat || - '{{host}}/{{owner}}/{{repository}}/commit/{{hash}}' - config.compareUrlFormat = config.compareUrlFormat || - '{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}' - config.userUrlFormat = config.userUrlFormat || - '{{host}}/{{user}}' - config.issuePrefixes = config.issuePrefixes || ['#'] - - return config -} - -// expand on the simple mustache-style templates supported in -// configuration (we may eventually want to use handlebars for this). -function expandTemplate (template, context) { - let expanded = template - Object.keys(context).forEach(key => { - expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key]) - }) - return expanded -} - - -/***/ }), - -/***/ 86207: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const dateFormat = __nccwpck_require__(51512) -const join = __nccwpck_require__(85622).join -const readFileSync = __nccwpck_require__(35747).readFileSync -const semverValid = __nccwpck_require__(40725).valid -const through = __nccwpck_require__(18180) -const util = __nccwpck_require__(78857) -const _ = __nccwpck_require__(90250) - -function conventionalChangelogWriterInit (context, options) { - context = _.extend({ - commit: 'commits', - issue: 'issues', - date: dateFormat(new Date(), 'yyyy-mm-dd', true) - }, context) - - if (!_.isBoolean(context.linkReferences) && (context.repository || context.repoUrl) && context.commit && context.issue) { - context.linkReferences = true - } - - options = _.assign({ - groupBy: 'type', - commitsSort: 'header', - noteGroupsSort: 'title', - notesSort: 'text', - generateOn: function (commit) { - return semverValid(commit.version) - }, - finalizeContext: function (context) { - return context - }, - debug: function () {}, - reverse: false, - includeDetails: false, - ignoreReverted: true, - doFlush: true, - mainTemplate: readFileSync(__nccwpck_require__.ab + "template1.hbs", 'utf-8'), - headerPartial: readFileSync(__nccwpck_require__.ab + "header1.hbs", 'utf-8'), - commitPartial: readFileSync(__nccwpck_require__.ab + "commit1.hbs", 'utf-8'), - footerPartial: readFileSync(__nccwpck_require__.ab + "footer.hbs", 'utf-8') - }, options) - - if ((!_.isFunction(options.transform) && _.isObject(options.transform)) || _.isUndefined(options.transform)) { - options.transform = _.assign({ - hash: function (hash) { - if (_.isString(hash)) { - return hash.substring(0, 7) - } - }, - header: function (header) { - return header.substring(0, 100) - }, - committerDate: function (date) { - if (!date) { - return - } - - return dateFormat(date, 'yyyy-mm-dd', true) - } - }, options.transform) - } - - let generateOn = options.generateOn - if (_.isString(generateOn)) { - generateOn = function (commit) { - return !_.isUndefined(commit[options.generateOn]) - } - } else if (!_.isFunction(generateOn)) { - generateOn = function () { - return false - } - } - - options.commitGroupsSort = util.functionify(options.commitGroupsSort) - options.commitsSort = util.functionify(options.commitsSort) - options.noteGroupsSort = util.functionify(options.noteGroupsSort) - options.notesSort = util.functionify(options.notesSort) - - return { context, options, generateOn } -} - -function conventionalChangelogWriterParseStream (context, options) { - let generateOn - ({ context, options, generateOn } = conventionalChangelogWriterInit(context, options)) - let commits = [] - let neverGenerated = true - let savedKeyCommit - let firstRelease = true - return through.obj(function (chunk, _enc, cb) { - try { - let result - const commit = util.processCommit(chunk, options.transform, context) - const keyCommit = commit || chunk - - // previous blocks of logs - if (options.reverse) { - if (commit) { - commits.push(commit) - } - - if (generateOn(keyCommit, commits, context, options)) { - neverGenerated = false - result = util.generate(options, commits, context, keyCommit) - if (options.includeDetails) { - this.push({ - log: result, - keyCommit: keyCommit - }) - } else { - this.push(result) - } - - commits = [] - } - } else { - if (generateOn(keyCommit, commits, context, options)) { - neverGenerated = false - result = util.generate(options, commits, context, savedKeyCommit) - - if (!firstRelease || options.doFlush) { - if (options.includeDetails) { - this.push({ - log: result, - keyCommit: savedKeyCommit - }) - } else { - this.push(result) - } - } - - firstRelease = false - commits = [] - savedKeyCommit = keyCommit - } - - if (commit) { - commits.push(commit) - } - } - - cb() - } catch (err) { - cb(err) - } - }, function (cb) { - if (!options.doFlush && (options.reverse || neverGenerated)) { - cb(null) - return - } - - try { - const result = util.generate(options, commits, context, savedKeyCommit) - - if (options.includeDetails) { - this.push({ - log: result, - keyCommit: savedKeyCommit - }) - } else { - this.push(result) - } - - cb() - } catch (err) { - cb(err) - } - }) -} - -/* - * Given an array of commits, returns a string representing a CHANGELOG entry. - */ -conventionalChangelogWriterParseStream.parseArray = (rawCommits, context, options) => { - let generateOn - rawCommits = [...rawCommits]; - ({ context, options, generateOn } = conventionalChangelogWriterInit(context, options)) - let commits = [] - let savedKeyCommit - if (options.reverse) { - rawCommits.reverse() - } - const entries = [] - for (const rawCommit of rawCommits) { - const commit = util.processCommit(rawCommit, options.transform, context) - const keyCommit = commit || rawCommit - if (generateOn(keyCommit, commits, context, options)) { - entries.push(util.generate(options, commits, context, savedKeyCommit)) - savedKeyCommit = keyCommit - commits = [] - } - if (commit) { - commits.push(commit) - } - } - if (options.reverse) { - entries.reverse() - return util.generate(options, commits, context, savedKeyCommit) + entries.join('') - } else { - return entries.join('') + util.generate(options, commits, context, savedKeyCommit) - } -} - -module.exports = conventionalChangelogWriterParseStream - - -/***/ }), - -/***/ 78857: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const conventionalCommitsFilter = __nccwpck_require__(55003) -const Handlebars = __nccwpck_require__(97492) -const semver = __nccwpck_require__(40725) -const _ = __nccwpck_require__(90250) -const stringify = __nccwpck_require__(57073) - -function compileTemplates (templates) { - const main = templates.mainTemplate - const headerPartial = templates.headerPartial - const commitPartial = templates.commitPartial - const footerPartial = templates.footerPartial - const partials = templates.partials - - if (_.isString(headerPartial)) { - Handlebars.registerPartial('header', headerPartial) - } - - if (_.isString(commitPartial)) { - Handlebars.registerPartial('commit', commitPartial) - } - - if (_.isString(footerPartial)) { - Handlebars.registerPartial('footer', footerPartial) - } - - _.forEach(partials, function (partial, name) { - if (_.isString(partial)) { - Handlebars.registerPartial(name, partial) - } - }) - - return Handlebars.compile(main, { - noEscape: true - }) -} - -function functionify (strOrArr) { - if (strOrArr && !_.isFunction(strOrArr)) { - return (a, b) => { - let str1 = '' - let str2 = '' - if (Array.isArray(strOrArr)) { - for (const key of strOrArr) { - str1 += a[key] || '' - str2 += b[key] || '' - } - } else { - str1 += a[strOrArr] - str2 += b[strOrArr] + }], + getAnalysis: ["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"], + getSarif: ["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"], + listAlertInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], + listAlertsInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { + renamed: ["codeScanning", "listAlertInstances"] + }], + listRecentAnalyses: ["GET /repos/{owner}/{repo}/code-scanning/analyses"], + updateAlert: ["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"], + uploadSarif: ["POST /repos/{owner}/{repo}/code-scanning/sarifs"] + }, + codesOfConduct: { + getAllCodesOfConduct: ["GET /codes_of_conduct"], + getConductCode: ["GET /codes_of_conduct/{key}"] + }, + emojis: { + get: ["GET /emojis"] + }, + enterpriseAdmin: { + disableSelectedOrganizationGithubActionsEnterprise: ["DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], + enableSelectedOrganizationGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}"], + getAllowedActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/selected-actions"], + getGithubActionsPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions"], + listSelectedOrganizationsEnabledGithubActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/organizations"], + setAllowedActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"], + setGithubActionsPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions"], + setSelectedOrganizationsEnabledGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations"] + }, + gists: { + checkIsStarred: ["GET /gists/{gist_id}/star"], + create: ["POST /gists"], + createComment: ["POST /gists/{gist_id}/comments"], + delete: ["DELETE /gists/{gist_id}"], + deleteComment: ["DELETE /gists/{gist_id}/comments/{comment_id}"], + fork: ["POST /gists/{gist_id}/forks"], + get: ["GET /gists/{gist_id}"], + getComment: ["GET /gists/{gist_id}/comments/{comment_id}"], + getRevision: ["GET /gists/{gist_id}/{sha}"], + list: ["GET /gists"], + listComments: ["GET /gists/{gist_id}/comments"], + listCommits: ["GET /gists/{gist_id}/commits"], + listForUser: ["GET /users/{username}/gists"], + listForks: ["GET /gists/{gist_id}/forks"], + listPublic: ["GET /gists/public"], + listStarred: ["GET /gists/starred"], + star: ["PUT /gists/{gist_id}/star"], + unstar: ["DELETE /gists/{gist_id}/star"], + update: ["PATCH /gists/{gist_id}"], + updateComment: ["PATCH /gists/{gist_id}/comments/{comment_id}"] + }, + git: { + createBlob: ["POST /repos/{owner}/{repo}/git/blobs"], + createCommit: ["POST /repos/{owner}/{repo}/git/commits"], + createRef: ["POST /repos/{owner}/{repo}/git/refs"], + createTag: ["POST /repos/{owner}/{repo}/git/tags"], + createTree: ["POST /repos/{owner}/{repo}/git/trees"], + deleteRef: ["DELETE /repos/{owner}/{repo}/git/refs/{ref}"], + getBlob: ["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"], + getCommit: ["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"], + getRef: ["GET /repos/{owner}/{repo}/git/ref/{ref}"], + getTag: ["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"], + getTree: ["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"], + listMatchingRefs: ["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"], + updateRef: ["PATCH /repos/{owner}/{repo}/git/refs/{ref}"] + }, + gitignore: { + getAllTemplates: ["GET /gitignore/templates"], + getTemplate: ["GET /gitignore/templates/{name}"] + }, + interactions: { + getRestrictionsForAuthenticatedUser: ["GET /user/interaction-limits"], + getRestrictionsForOrg: ["GET /orgs/{org}/interaction-limits"], + getRestrictionsForRepo: ["GET /repos/{owner}/{repo}/interaction-limits"], + getRestrictionsForYourPublicRepos: ["GET /user/interaction-limits", {}, { + renamed: ["interactions", "getRestrictionsForAuthenticatedUser"] + }], + removeRestrictionsForAuthenticatedUser: ["DELETE /user/interaction-limits"], + removeRestrictionsForOrg: ["DELETE /orgs/{org}/interaction-limits"], + removeRestrictionsForRepo: ["DELETE /repos/{owner}/{repo}/interaction-limits"], + removeRestrictionsForYourPublicRepos: ["DELETE /user/interaction-limits", {}, { + renamed: ["interactions", "removeRestrictionsForAuthenticatedUser"] + }], + setRestrictionsForAuthenticatedUser: ["PUT /user/interaction-limits"], + setRestrictionsForOrg: ["PUT /orgs/{org}/interaction-limits"], + setRestrictionsForRepo: ["PUT /repos/{owner}/{repo}/interaction-limits"], + setRestrictionsForYourPublicRepos: ["PUT /user/interaction-limits", {}, { + renamed: ["interactions", "setRestrictionsForAuthenticatedUser"] + }] + }, + issues: { + addAssignees: ["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"], + addLabels: ["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"], + checkUserCanBeAssigned: ["GET /repos/{owner}/{repo}/assignees/{assignee}"], + create: ["POST /repos/{owner}/{repo}/issues"], + createComment: ["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"], + createLabel: ["POST /repos/{owner}/{repo}/labels"], + createMilestone: ["POST /repos/{owner}/{repo}/milestones"], + deleteComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"], + deleteLabel: ["DELETE /repos/{owner}/{repo}/labels/{name}"], + deleteMilestone: ["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"], + get: ["GET /repos/{owner}/{repo}/issues/{issue_number}"], + getComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"], + getEvent: ["GET /repos/{owner}/{repo}/issues/events/{event_id}"], + getLabel: ["GET /repos/{owner}/{repo}/labels/{name}"], + getMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}"], + list: ["GET /issues"], + listAssignees: ["GET /repos/{owner}/{repo}/assignees"], + listComments: ["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"], + listCommentsForRepo: ["GET /repos/{owner}/{repo}/issues/comments"], + listEvents: ["GET /repos/{owner}/{repo}/issues/{issue_number}/events"], + listEventsForRepo: ["GET /repos/{owner}/{repo}/issues/events"], + listEventsForTimeline: ["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"], + listForAuthenticatedUser: ["GET /user/issues"], + listForOrg: ["GET /orgs/{org}/issues"], + listForRepo: ["GET /repos/{owner}/{repo}/issues"], + listLabelsForMilestone: ["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"], + listLabelsForRepo: ["GET /repos/{owner}/{repo}/labels"], + listLabelsOnIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"], + listMilestones: ["GET /repos/{owner}/{repo}/milestones"], + lock: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"], + removeAllLabels: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"], + removeAssignees: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"], + removeLabel: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"], + setLabels: ["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"], + unlock: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"], + update: ["PATCH /repos/{owner}/{repo}/issues/{issue_number}"], + updateComment: ["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"], + updateLabel: ["PATCH /repos/{owner}/{repo}/labels/{name}"], + updateMilestone: ["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"] + }, + licenses: { + get: ["GET /licenses/{license}"], + getAllCommonlyUsed: ["GET /licenses"], + getForRepo: ["GET /repos/{owner}/{repo}/license"] + }, + markdown: { + render: ["POST /markdown"], + renderRaw: ["POST /markdown/raw", { + headers: { + "content-type": "text/plain; charset=utf-8" } - return str1.localeCompare(str2) - } - } else { - return strOrArr - } -} - -function getCommitGroups (groupBy, commits, groupsSort, commitsSort) { - const commitGroups = [] - const commitGroupsObj = _.groupBy(commits, function (commit) { - return commit[groupBy] || '' - }) - - _.forEach(commitGroupsObj, function (commits, title) { - if (title === '') { - title = false - } - - if (commitsSort) { - commits.sort(commitsSort) - } - - commitGroups.push({ - title: title, - commits: commits - }) - }) - - if (groupsSort) { - commitGroups.sort(groupsSort) - } - - return commitGroups -} - -function getNoteGroups (notes, noteGroupsSort, notesSort) { - const retGroups = [] - - _.forEach(notes, function (note) { - const title = note.title - let titleExists = false - - _.forEach(retGroups, function (group) { - if (group.title === title) { - titleExists = true - group.notes.push(note) - return false + }] + }, + meta: { + get: ["GET /meta"], + getOctocat: ["GET /octocat"], + getZen: ["GET /zen"], + root: ["GET /"] + }, + migrations: { + cancelImport: ["DELETE /repos/{owner}/{repo}/import"], + deleteArchiveForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/archive"], + deleteArchiveForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/archive"], + downloadArchiveForOrg: ["GET /orgs/{org}/migrations/{migration_id}/archive"], + getArchiveForAuthenticatedUser: ["GET /user/migrations/{migration_id}/archive"], + getCommitAuthors: ["GET /repos/{owner}/{repo}/import/authors"], + getImportStatus: ["GET /repos/{owner}/{repo}/import"], + getLargeFiles: ["GET /repos/{owner}/{repo}/import/large_files"], + getStatusForAuthenticatedUser: ["GET /user/migrations/{migration_id}"], + getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"], + listForAuthenticatedUser: ["GET /user/migrations"], + listForOrg: ["GET /orgs/{org}/migrations"], + listReposForAuthenticatedUser: ["GET /user/migrations/{migration_id}/repositories"], + listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"], + listReposForUser: ["GET /user/migrations/{migration_id}/repositories", {}, { + renamed: ["migrations", "listReposForAuthenticatedUser"] + }], + mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"], + setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"], + startForAuthenticatedUser: ["POST /user/migrations"], + startForOrg: ["POST /orgs/{org}/migrations"], + startImport: ["PUT /repos/{owner}/{repo}/import"], + unlockRepoForAuthenticatedUser: ["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"], + unlockRepoForOrg: ["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"], + updateImport: ["PATCH /repos/{owner}/{repo}/import"] + }, + orgs: { + blockUser: ["PUT /orgs/{org}/blocks/{username}"], + cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], + checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], + checkMembershipForUser: ["GET /orgs/{org}/members/{username}"], + checkPublicMembershipForUser: ["GET /orgs/{org}/public_members/{username}"], + convertMemberToOutsideCollaborator: ["PUT /orgs/{org}/outside_collaborators/{username}"], + createInvitation: ["POST /orgs/{org}/invitations"], + createWebhook: ["POST /orgs/{org}/hooks"], + deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], + get: ["GET /orgs/{org}"], + getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], + getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], + getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], + getWebhookDelivery: ["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"], + list: ["GET /organizations"], + listAppInstallations: ["GET /orgs/{org}/installations"], + listBlockedUsers: ["GET /orgs/{org}/blocks"], + listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], + listForAuthenticatedUser: ["GET /user/orgs"], + listForUser: ["GET /users/{username}/orgs"], + listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], + listMembers: ["GET /orgs/{org}/members"], + listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], + listPendingInvitations: ["GET /orgs/{org}/invitations"], + listPublicMembers: ["GET /orgs/{org}/public_members"], + listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], + listWebhooks: ["GET /orgs/{org}/hooks"], + pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], + removeMember: ["DELETE /orgs/{org}/members/{username}"], + removeMembershipForUser: ["DELETE /orgs/{org}/memberships/{username}"], + removeOutsideCollaborator: ["DELETE /orgs/{org}/outside_collaborators/{username}"], + removePublicMembershipForAuthenticatedUser: ["DELETE /orgs/{org}/public_members/{username}"], + setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], + setPublicMembershipForAuthenticatedUser: ["PUT /orgs/{org}/public_members/{username}"], + unblockUser: ["DELETE /orgs/{org}/blocks/{username}"], + update: ["PATCH /orgs/{org}"], + updateMembershipForAuthenticatedUser: ["PATCH /user/memberships/orgs/{org}"], + updateWebhook: ["PATCH /orgs/{org}/hooks/{hook_id}"], + updateWebhookConfigForOrg: ["PATCH /orgs/{org}/hooks/{hook_id}/config"] + }, + packages: { + deletePackageForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}"], + deletePackageForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}"], + deletePackageForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}"], + deletePackageVersionForAuthenticatedUser: ["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], + deletePackageVersionForOrg: ["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + deletePackageVersionForUser: ["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getAllPackageVersionsForAPackageOwnedByAnOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions", {}, { + renamed: ["packages", "getAllPackageVersionsForPackageOwnedByOrg"] + }], + getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions", {}, { + renamed: ["packages", "getAllPackageVersionsForPackageOwnedByAuthenticatedUser"] + }], + getAllPackageVersionsForPackageOwnedByAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions"], + getAllPackageVersionsForPackageOwnedByOrg: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"], + getAllPackageVersionsForPackageOwnedByUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions"], + getPackageForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}"], + getPackageForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}"], + getPackageForUser: ["GET /users/{username}/packages/{package_type}/{package_name}"], + getPackageVersionForAuthenticatedUser: ["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getPackageVersionForOrganization: ["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + getPackageVersionForUser: ["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"], + listPackagesForAuthenticatedUser: ["GET /user/packages"], + listPackagesForOrganization: ["GET /orgs/{org}/packages"], + listPackagesForUser: ["GET /users/{username}/packages"], + restorePackageForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"], + restorePackageVersionForAuthenticatedUser: ["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], + restorePackageVersionForOrg: ["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"], + restorePackageVersionForUser: ["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"] + }, + projects: { + addCollaborator: ["PUT /projects/{project_id}/collaborators/{username}"], + createCard: ["POST /projects/columns/{column_id}/cards"], + createColumn: ["POST /projects/{project_id}/columns"], + createForAuthenticatedUser: ["POST /user/projects"], + createForOrg: ["POST /orgs/{org}/projects"], + createForRepo: ["POST /repos/{owner}/{repo}/projects"], + delete: ["DELETE /projects/{project_id}"], + deleteCard: ["DELETE /projects/columns/cards/{card_id}"], + deleteColumn: ["DELETE /projects/columns/{column_id}"], + get: ["GET /projects/{project_id}"], + getCard: ["GET /projects/columns/cards/{card_id}"], + getColumn: ["GET /projects/columns/{column_id}"], + getPermissionForUser: ["GET /projects/{project_id}/collaborators/{username}/permission"], + listCards: ["GET /projects/columns/{column_id}/cards"], + listCollaborators: ["GET /projects/{project_id}/collaborators"], + listColumns: ["GET /projects/{project_id}/columns"], + listForOrg: ["GET /orgs/{org}/projects"], + listForRepo: ["GET /repos/{owner}/{repo}/projects"], + listForUser: ["GET /users/{username}/projects"], + moveCard: ["POST /projects/columns/cards/{card_id}/moves"], + moveColumn: ["POST /projects/columns/{column_id}/moves"], + removeCollaborator: ["DELETE /projects/{project_id}/collaborators/{username}"], + update: ["PATCH /projects/{project_id}"], + updateCard: ["PATCH /projects/columns/cards/{card_id}"], + updateColumn: ["PATCH /projects/columns/{column_id}"] + }, + pulls: { + checkIfMerged: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + create: ["POST /repos/{owner}/{repo}/pulls"], + createReplyForReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"], + createReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + createReviewComment: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"], + deletePendingReview: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + deleteReviewComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + dismissReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"], + get: ["GET /repos/{owner}/{repo}/pulls/{pull_number}"], + getReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + getReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"], + list: ["GET /repos/{owner}/{repo}/pulls"], + listCommentsForReview: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"], + listCommits: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"], + listFiles: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"], + listRequestedReviewers: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + listReviewComments: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"], + listReviewCommentsForRepo: ["GET /repos/{owner}/{repo}/pulls/comments"], + listReviews: ["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"], + merge: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"], + removeRequestedReviewers: ["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + requestReviewers: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"], + submitReview: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"], + update: ["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"], + updateBranch: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"], + updateReview: ["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"], + updateReviewComment: ["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"] + }, + rateLimit: { + get: ["GET /rate_limit"] + }, + reactions: { + createForCommitComment: ["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"], + createForIssue: ["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"], + createForIssueComment: ["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], + createForPullRequestReviewComment: ["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], + createForRelease: ["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"], + createForTeamDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], + createForTeamDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"], + deleteForCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"], + deleteForIssue: ["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"], + deleteForIssueComment: ["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"], + deleteForPullRequestComment: ["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"], + deleteForTeamDiscussion: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"], + deleteForTeamDiscussionComment: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"], + listForCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"], + listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"], + listForIssueComment: ["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"], + listForPullRequestReviewComment: ["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"], + listForTeamDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"], + listForTeamDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"] + }, + repos: { + acceptInvitation: ["PATCH /user/repository_invitations/{invitation_id}", {}, { + renamed: ["repos", "acceptInvitationForAuthenticatedUser"] + }], + acceptInvitationForAuthenticatedUser: ["PATCH /user/repository_invitations/{invitation_id}"], + addAppAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + addCollaborator: ["PUT /repos/{owner}/{repo}/collaborators/{username}"], + addStatusCheckContexts: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + addTeamAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + addUserAccessRestrictions: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], + checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts"], + compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], + compareCommitsWithBasehead: ["GET /repos/{owner}/{repo}/compare/{basehead}"], + createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], + createCommitComment: ["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"], + createCommitSignatureProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"], + createDeployKey: ["POST /repos/{owner}/{repo}/keys"], + createDeployment: ["POST /repos/{owner}/{repo}/deployments"], + createDeploymentStatus: ["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], + createDispatchEvent: ["POST /repos/{owner}/{repo}/dispatches"], + createForAuthenticatedUser: ["POST /user/repos"], + createFork: ["POST /repos/{owner}/{repo}/forks"], + createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateEnvironment: ["PUT /repos/{owner}/{repo}/environments/{environment_name}"], + createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], + createPagesSite: ["POST /repos/{owner}/{repo}/pages"], + createRelease: ["POST /repos/{owner}/{repo}/releases"], + createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate"], + createWebhook: ["POST /repos/{owner}/{repo}/hooks"], + declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}", {}, { + renamed: ["repos", "declineInvitationForAuthenticatedUser"] + }], + declineInvitationForAuthenticatedUser: ["DELETE /user/repository_invitations/{invitation_id}"], + delete: ["DELETE /repos/{owner}/{repo}"], + deleteAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], + deleteAdminBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + deleteAnEnvironment: ["DELETE /repos/{owner}/{repo}/environments/{environment_name}"], + deleteAutolink: ["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"], + deleteBranchProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"], + deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"], + deleteCommitSignatureProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"], + deleteDeployment: ["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"], + deleteFile: ["DELETE /repos/{owner}/{repo}/contents/{path}"], + deleteInvitation: ["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"], + deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"], + deletePullRequestReviewProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + deleteRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_id}"], + deleteReleaseAsset: ["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"], + deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], + disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes"], + disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"], + disableVulnerabilityAlerts: ["DELETE /repos/{owner}/{repo}/vulnerability-alerts"], + downloadArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}", {}, { + renamed: ["repos", "downloadZipballArchive"] + }], + downloadTarballArchive: ["GET /repos/{owner}/{repo}/tarball/{ref}"], + downloadZipballArchive: ["GET /repos/{owner}/{repo}/zipball/{ref}"], + enableAutomatedSecurityFixes: ["PUT /repos/{owner}/{repo}/automated-security-fixes"], + enableLfsForRepo: ["PUT /repos/{owner}/{repo}/lfs"], + enableVulnerabilityAlerts: ["PUT /repos/{owner}/{repo}/vulnerability-alerts"], + generateReleaseNotes: ["POST /repos/{owner}/{repo}/releases/generate-notes"], + get: ["GET /repos/{owner}/{repo}"], + getAccessRestrictions: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"], + getAdminBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + getAllEnvironments: ["GET /repos/{owner}/{repo}/environments"], + getAllStatusCheckContexts: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"], + getAllTopics: ["GET /repos/{owner}/{repo}/topics", { + mediaType: { + previews: ["mercy"] } - }) - - if (!titleExists) { - retGroups.push({ - title: title, - notes: [note] - }) - } - }) - - if (noteGroupsSort) { - retGroups.sort(noteGroupsSort) - } - - if (notesSort) { - _.forEach(retGroups, function (group) { - group.notes.sort(notesSort) - }) - } - - return retGroups -} - -function processCommit (chunk, transform, context) { - let commit - - try { - chunk = JSON.parse(chunk) - } catch (e) {} - - commit = _.cloneDeep(chunk) - - if (_.isFunction(transform)) { - commit = transform(commit, context) - - if (commit) { - commit.raw = chunk - } - - return commit - } - - _.forEach(transform, function (el, path) { - let value = _.get(commit, path) - - if (_.isFunction(el)) { - value = el(value, path) - } else { - value = el - } - - _.set(commit, path, value) - }) - - commit.raw = chunk - - return commit -} - -function getExtraContext (commits, notes, options) { - const context = {} - - // group `commits` by `options.groupBy` - context.commitGroups = getCommitGroups(options.groupBy, commits, options.commitGroupsSort, options.commitsSort) - - // group `notes` for footer - context.noteGroups = getNoteGroups(notes, options.noteGroupsSort, options.notesSort) - - return context -} - -function generate (options, commits, context, keyCommit) { - let notes = [] - let filteredCommits - const compiled = compileTemplates(options) - - if (options.ignoreReverted) { - filteredCommits = conventionalCommitsFilter(commits) - } else { - filteredCommits = _.clone(commits) - } - - _.forEach(filteredCommits, function (commit) { - _.map(commit.notes, function (note) { - note.commit = commit - - return note - }) - - notes = notes.concat(commit.notes) - }) - - context = _.merge({}, context, keyCommit, getExtraContext(filteredCommits, notes, options)) - - if (keyCommit && keyCommit.committerDate) { - context.date = keyCommit.committerDate - } - - if (context.version && semver.valid(context.version)) { - context.isPatch = context.isPatch || semver.patch(context.version) !== 0 - } - - context = options.finalizeContext(context, options, filteredCommits, keyCommit, commits) - options.debug('Your final context is:\n' + stringify(context, null, 2)) - - return compiled(context) -} - -module.exports = { - compileTemplates: compileTemplates, - functionify: functionify, - getCommitGroups: getCommitGroups, - getNoteGroups: getNoteGroups, - processCommit: processCommit, - getExtraContext: getExtraContext, - generate: generate -} - - -/***/ }), - -/***/ 40725: -/***/ ((module, exports) => { - -exports = module.exports = SemVer - -var debug -/* istanbul ignore next */ -if (typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug = function () { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift('SEMVER') - console.log.apply(console, args) - } -} else { - debug = function () {} -} - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0' - -var MAX_LENGTH = 256 -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16 - -// The actual regexps go on exports.re -var re = exports.re = [] -var src = exports.src = [] -var t = exports.tokens = {} -var R = 0 - -function tok (n) { - t[n] = R++ -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -tok('NUMERICIDENTIFIER') -src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' -tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' - -// ## Main Version -// Three dot-separated numeric identifiers. - -tok('MAINVERSION') -src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIER] + ')' - -tok('MAINVERSIONLOOSE') -src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -tok('PRERELEASEIDENTIFIER') -src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' - -tok('PRERELEASEIDENTIFIERLOOSE') -src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + - '|' + src[t.NONNUMERICIDENTIFIER] + ')' - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -tok('PRERELEASE') -src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' - -tok('PRERELEASELOOSE') -src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -tok('BUILD') -src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + - '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. + }], + getAppsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"], + getAutolink: ["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"], + getBranch: ["GET /repos/{owner}/{repo}/branches/{branch}"], + getBranchProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection"], + getClones: ["GET /repos/{owner}/{repo}/traffic/clones"], + getCodeFrequencyStats: ["GET /repos/{owner}/{repo}/stats/code_frequency"], + getCollaboratorPermissionLevel: ["GET /repos/{owner}/{repo}/collaborators/{username}/permission"], + getCombinedStatusForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/status"], + getCommit: ["GET /repos/{owner}/{repo}/commits/{ref}"], + getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"], + getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"], + getCommitSignatureProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"], + getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"], + getContent: ["GET /repos/{owner}/{repo}/contents/{path}"], + getContributorsStats: ["GET /repos/{owner}/{repo}/stats/contributors"], + getDeployKey: ["GET /repos/{owner}/{repo}/keys/{key_id}"], + getDeployment: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}"], + getDeploymentStatus: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"], + getEnvironment: ["GET /repos/{owner}/{repo}/environments/{environment_name}"], + getLatestPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/latest"], + getLatestRelease: ["GET /repos/{owner}/{repo}/releases/latest"], + getPages: ["GET /repos/{owner}/{repo}/pages"], + getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], + getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], + getPullRequestReviewProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + getPunchCardStats: ["GET /repos/{owner}/{repo}/stats/punch_card"], + getReadme: ["GET /repos/{owner}/{repo}/readme"], + getReadmeInDirectory: ["GET /repos/{owner}/{repo}/readme/{dir}"], + getRelease: ["GET /repos/{owner}/{repo}/releases/{release_id}"], + getReleaseAsset: ["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"], + getReleaseByTag: ["GET /repos/{owner}/{repo}/releases/tags/{tag}"], + getStatusChecksProtection: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + getTeamsWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"], + getTopPaths: ["GET /repos/{owner}/{repo}/traffic/popular/paths"], + getTopReferrers: ["GET /repos/{owner}/{repo}/traffic/popular/referrers"], + getUsersWithAccessToProtectedBranch: ["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"], + getViews: ["GET /repos/{owner}/{repo}/traffic/views"], + getWebhook: ["GET /repos/{owner}/{repo}/hooks/{hook_id}"], + getWebhookConfigForRepo: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"], + getWebhookDelivery: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"], + listAutolinks: ["GET /repos/{owner}/{repo}/autolinks"], + listBranches: ["GET /repos/{owner}/{repo}/branches"], + listBranchesForHeadCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"], + listCollaborators: ["GET /repos/{owner}/{repo}/collaborators"], + listCommentsForCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"], + listCommitCommentsForRepo: ["GET /repos/{owner}/{repo}/comments"], + listCommitStatusesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/statuses"], + listCommits: ["GET /repos/{owner}/{repo}/commits"], + listContributors: ["GET /repos/{owner}/{repo}/contributors"], + listDeployKeys: ["GET /repos/{owner}/{repo}/keys"], + listDeploymentStatuses: ["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"], + listDeployments: ["GET /repos/{owner}/{repo}/deployments"], + listForAuthenticatedUser: ["GET /user/repos"], + listForOrg: ["GET /orgs/{org}/repos"], + listForUser: ["GET /users/{username}/repos"], + listForks: ["GET /repos/{owner}/{repo}/forks"], + listInvitations: ["GET /repos/{owner}/{repo}/invitations"], + listInvitationsForAuthenticatedUser: ["GET /user/repository_invitations"], + listLanguages: ["GET /repos/{owner}/{repo}/languages"], + listPagesBuilds: ["GET /repos/{owner}/{repo}/pages/builds"], + listPublic: ["GET /repositories"], + listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"], + listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], + listReleases: ["GET /repos/{owner}/{repo}/releases"], + listTags: ["GET /repos/{owner}/{repo}/tags"], + listTeams: ["GET /repos/{owner}/{repo}/teams"], + listWebhookDeliveries: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"], + listWebhooks: ["GET /repos/{owner}/{repo}/hooks"], + merge: ["POST /repos/{owner}/{repo}/merges"], + mergeUpstream: ["POST /repos/{owner}/{repo}/merge-upstream"], + pingWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"], + redeliverWebhookDelivery: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"], + removeAppAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + removeCollaborator: ["DELETE /repos/{owner}/{repo}/collaborators/{username}"], + removeStatusCheckContexts: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + removeStatusCheckProtection: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + removeTeamAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + removeUserAccessRestrictions: ["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], + replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics", { + mediaType: { + previews: ["mercy"] + } + }], + requestPagesBuild: ["POST /repos/{owner}/{repo}/pages/builds"], + setAdminBranchProtection: ["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"], + setAppAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", {}, { + mapToData: "apps" + }], + setStatusCheckContexts: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", {}, { + mapToData: "contexts" + }], + setTeamAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", {}, { + mapToData: "teams" + }], + setUserAccessRestrictions: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", {}, { + mapToData: "users" + }], + testPushWebhook: ["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"], + transfer: ["POST /repos/{owner}/{repo}/transfer"], + update: ["PATCH /repos/{owner}/{repo}"], + updateBranchProtection: ["PUT /repos/{owner}/{repo}/branches/{branch}/protection"], + updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], + updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], + updateInvitation: ["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"], + updatePullRequestReviewProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"], + updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], + updateReleaseAsset: ["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"], + updateStatusCheckPotection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", {}, { + renamed: ["repos", "updateStatusCheckProtection"] + }], + updateStatusCheckProtection: ["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"], + updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], + updateWebhookConfigForRepo: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"], + uploadReleaseAsset: ["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", { + baseUrl: "https://uploads.github.com" + }] + }, + search: { + code: ["GET /search/code"], + commits: ["GET /search/commits"], + issuesAndPullRequests: ["GET /search/issues"], + labels: ["GET /search/labels"], + repos: ["GET /search/repositories"], + topics: ["GET /search/topics", { + mediaType: { + previews: ["mercy"] + } + }], + users: ["GET /search/users"] + }, + secretScanning: { + getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], + listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], + listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"] + }, + teams: { + addOrUpdateMembershipForUserInOrg: ["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"], + addOrUpdateProjectPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}"], + addOrUpdateRepoPermissionsInOrg: ["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + checkPermissionsForProjectInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects/{project_id}"], + checkPermissionsForRepoInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + create: ["POST /orgs/{org}/teams"], + createDiscussionCommentInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], + createDiscussionInOrg: ["POST /orgs/{org}/teams/{team_slug}/discussions"], + deleteDiscussionCommentInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + deleteDiscussionInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + deleteInOrg: ["DELETE /orgs/{org}/teams/{team_slug}"], + getByName: ["GET /orgs/{org}/teams/{team_slug}"], + getDiscussionCommentInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + getDiscussionInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + getMembershipForUserInOrg: ["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"], + list: ["GET /orgs/{org}/teams"], + listChildInOrg: ["GET /orgs/{org}/teams/{team_slug}/teams"], + listDiscussionCommentsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"], + listDiscussionsInOrg: ["GET /orgs/{org}/teams/{team_slug}/discussions"], + listForAuthenticatedUser: ["GET /user/teams"], + listMembersInOrg: ["GET /orgs/{org}/teams/{team_slug}/members"], + listPendingInvitationsInOrg: ["GET /orgs/{org}/teams/{team_slug}/invitations"], + listProjectsInOrg: ["GET /orgs/{org}/teams/{team_slug}/projects"], + listReposInOrg: ["GET /orgs/{org}/teams/{team_slug}/repos"], + removeMembershipForUserInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"], + removeProjectInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}"], + removeRepoInOrg: ["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"], + updateDiscussionCommentInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"], + updateDiscussionInOrg: ["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"], + updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] + }, + users: { + addEmailForAuthenticated: ["POST /user/emails", {}, { + renamed: ["users", "addEmailForAuthenticatedUser"] + }], + addEmailForAuthenticatedUser: ["POST /user/emails"], + block: ["PUT /user/blocks/{username}"], + checkBlocked: ["GET /user/blocks/{username}"], + checkFollowingForUser: ["GET /users/{username}/following/{target_user}"], + checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"], + createGpgKeyForAuthenticated: ["POST /user/gpg_keys", {}, { + renamed: ["users", "createGpgKeyForAuthenticatedUser"] + }], + createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], + createPublicSshKeyForAuthenticated: ["POST /user/keys", {}, { + renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] + }], + createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], + deleteEmailForAuthenticated: ["DELETE /user/emails", {}, { + renamed: ["users", "deleteEmailForAuthenticatedUser"] + }], + deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], + deleteGpgKeyForAuthenticated: ["DELETE /user/gpg_keys/{gpg_key_id}", {}, { + renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] + }], + deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], + deletePublicSshKeyForAuthenticated: ["DELETE /user/keys/{key_id}", {}, { + renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] + }], + deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], + follow: ["PUT /user/following/{username}"], + getAuthenticated: ["GET /user"], + getByUsername: ["GET /users/{username}"], + getContextForUser: ["GET /users/{username}/hovercard"], + getGpgKeyForAuthenticated: ["GET /user/gpg_keys/{gpg_key_id}", {}, { + renamed: ["users", "getGpgKeyForAuthenticatedUser"] + }], + getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], + getPublicSshKeyForAuthenticated: ["GET /user/keys/{key_id}", {}, { + renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] + }], + getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], + list: ["GET /users"], + listBlockedByAuthenticated: ["GET /user/blocks", {}, { + renamed: ["users", "listBlockedByAuthenticatedUser"] + }], + listBlockedByAuthenticatedUser: ["GET /user/blocks"], + listEmailsForAuthenticated: ["GET /user/emails", {}, { + renamed: ["users", "listEmailsForAuthenticatedUser"] + }], + listEmailsForAuthenticatedUser: ["GET /user/emails"], + listFollowedByAuthenticated: ["GET /user/following", {}, { + renamed: ["users", "listFollowedByAuthenticatedUser"] + }], + listFollowedByAuthenticatedUser: ["GET /user/following"], + listFollowersForAuthenticatedUser: ["GET /user/followers"], + listFollowersForUser: ["GET /users/{username}/followers"], + listFollowingForUser: ["GET /users/{username}/following"], + listGpgKeysForAuthenticated: ["GET /user/gpg_keys", {}, { + renamed: ["users", "listGpgKeysForAuthenticatedUser"] + }], + listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], + listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], + listPublicEmailsForAuthenticated: ["GET /user/public_emails", {}, { + renamed: ["users", "listPublicEmailsForAuthenticatedUser"] + }], + listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], + listPublicKeysForUser: ["GET /users/{username}/keys"], + listPublicSshKeysForAuthenticated: ["GET /user/keys", {}, { + renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] + }], + listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"], + setPrimaryEmailVisibilityForAuthenticated: ["PATCH /user/email/visibility", {}, { + renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] + }], + setPrimaryEmailVisibilityForAuthenticatedUser: ["PATCH /user/email/visibility"], + unblock: ["DELETE /user/blocks/{username}"], + unfollow: ["DELETE /user/following/{username}"], + updateAuthenticated: ["PATCH /user"] + } +}; -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. +const VERSION = "5.13.0"; -tok('FULL') -tok('FULLPLAIN') -src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + - src[t.PRERELEASE] + '?' + - src[t.BUILD] + '?' +function endpointsToMethods(octokit, endpointsMap) { + const newMethods = {}; -src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' + for (const [scope, endpoints] of Object.entries(endpointsMap)) { + for (const [methodName, endpoint] of Object.entries(endpoints)) { + const [route, defaults, decorations] = endpoint; + const [method, url] = route.split(/ /); + const endpointDefaults = Object.assign({ + method, + url + }, defaults); -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -tok('LOOSEPLAIN') -src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + - src[t.PRERELEASELOOSE] + '?' + - src[t.BUILD] + '?' + if (!newMethods[scope]) { + newMethods[scope] = {}; + } -tok('LOOSE') -src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' + const scopeMethods = newMethods[scope]; -tok('GTLT') -src[t.GTLT] = '((?:<|>)?=?)' + if (decorations) { + scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); + continue; + } -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -tok('XRANGEIDENTIFIERLOOSE') -src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' -tok('XRANGEIDENTIFIER') -src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' + scopeMethods[methodName] = octokit.request.defaults(endpointDefaults); + } + } -tok('XRANGEPLAIN') -src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + - '(?:' + src[t.PRERELEASE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' + return newMethods; +} -tok('XRANGEPLAINLOOSE') -src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[t.PRERELEASELOOSE] + ')?' + - src[t.BUILD] + '?' + - ')?)?' +function decorate(octokit, scope, methodName, defaults, decorations) { + const requestWithDefaults = octokit.request.defaults(defaults); + /* istanbul ignore next */ -tok('XRANGE') -src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' -tok('XRANGELOOSE') -src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' + function withDecorations(...args) { + // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData` -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -tok('COERCE') -src[t.COERCE] = '(^|[^\\d])' + - '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])' -tok('COERCERTL') -re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') + if (decorations.mapToData) { + options = Object.assign({}, options, { + data: options[decorations.mapToData], + [decorations.mapToData]: undefined + }); + return requestWithDefaults(options); + } -// Tilde ranges. -// Meaning is "reasonably at or greater than" -tok('LONETILDE') -src[t.LONETILDE] = '(?:~>?)' + if (decorations.renamed) { + const [newScope, newMethodName] = decorations.renamed; + octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`); + } -tok('TILDETRIM') -src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' -re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') -var tildeTrimReplace = '$1~' + if (decorations.deprecated) { + octokit.log.warn(decorations.deprecated); + } -tok('TILDE') -src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' -tok('TILDELOOSE') -src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' + if (decorations.renamedParameters) { + // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + const options = requestWithDefaults.endpoint.merge(...args); -// Caret ranges. -// Meaning is "at least and backwards compatible with" -tok('LONECARET') -src[t.LONECARET] = '(?:\\^)' + for (const [name, alias] of Object.entries(decorations.renamedParameters)) { + if (name in options) { + octokit.log.warn(`"${name}" parameter is deprecated for "octokit.${scope}.${methodName}()". Use "${alias}" instead`); -tok('CARETTRIM') -src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' -re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') -var caretTrimReplace = '$1^' + if (!(alias in options)) { + options[alias] = options[name]; + } -tok('CARET') -src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' -tok('CARETLOOSE') -src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' + delete options[name]; + } + } -// A simple gt/lt/eq thing, or just "" to indicate "any version" -tok('COMPARATORLOOSE') -src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' -tok('COMPARATOR') -src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' + return requestWithDefaults(options); + } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -tok('COMPARATORTRIM') -src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + - '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' -// this one has to use the /g flag -re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') -var comparatorTrimReplace = '$1$2$3' + return requestWithDefaults(...args); + } -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -tok('HYPHENRANGE') -src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAIN] + ')' + - '\\s*$' + return Object.assign(withDecorations, requestWithDefaults); +} -tok('HYPHENRANGELOOSE') -src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[t.XRANGEPLAINLOOSE] + ')' + - '\\s*$' +function restEndpointMethods(octokit) { + const api = endpointsToMethods(octokit, Endpoints); + return { + rest: api + }; +} +restEndpointMethods.VERSION = VERSION; +function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit, Endpoints); + return _objectSpread2(_objectSpread2({}, api), {}, { + rest: api + }); +} +legacyRestEndpointMethods.VERSION = VERSION; -// Star ranges basically just allow anything at all. -tok('STAR') -src[t.STAR] = '(<|>)?=?\\s*\\*' +exports.legacyRestEndpointMethods = legacyRestEndpointMethods; +exports.restEndpointMethods = restEndpointMethods; +//# sourceMappingURL=index.js.map -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]) - if (!re[i]) { - re[i] = new RegExp(src[i]) - } -} -exports.parse = parse -function parse (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +/***/ }), - if (version instanceof SemVer) { - return version - } +/***/ 10537: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (typeof version !== 'string') { - return null - } +"use strict"; - if (version.length > MAX_LENGTH) { - return null - } - var r = options.loose ? re[t.LOOSE] : re[t.FULL] - if (!r.test(version)) { - return null - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - try { - return new SemVer(version, options) - } catch (er) { - return null - } -} +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -exports.valid = valid -function valid (version, options) { - var v = parse(version, options) - return v ? v.version : null -} +var deprecation = __nccwpck_require__(58932); +var once = _interopDefault(__nccwpck_require__(1223)); -exports.clean = clean -function clean (version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} +const logOnceCode = once(deprecation => console.warn(deprecation)); +const logOnceHeaders = once(deprecation => console.warn(deprecation)); +/** + * Error with extra properties to help with debugging + */ -exports.SemVer = SemVer +class RequestError extends Error { + constructor(message, statusCode, options) { + super(message); // Maintains proper stack trace (only available on V8) -function SemVer (version, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - } + /* istanbul ignore next */ - if (!(this instanceof SemVer)) { - return new SemVer(version, options) - } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose + this.name = "HttpError"; + this.status = statusCode; + let headers; - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } - if (!m) { - throw new TypeError('Invalid Version: ' + version) - } + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } // redact request credentials without mutating original request options - this.raw = version - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] + const requestCopy = Object.assign({}, options.request); - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } + if (options.request.headers.authorization) { + requestCopy.headers = Object.assign({}, options.request.headers, { + authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") + }); + } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } + requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit + // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications + .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended + // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header + .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); + this.request = requestCopy; // deprecations - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } + Object.defineProperty(this, "code", { + get() { + logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); + return statusCode; + } - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map(function (id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); + return headers || {}; } - return id - }) + + }); } - this.build = m[5] ? m[5].split('.') : [] - this.format() } -SemVer.prototype.format = function () { - this.version = this.major + '.' + this.minor + '.' + this.patch - if (this.prerelease.length) { - this.version += '-' + this.prerelease.join('.') - } - return this.version -} +exports.RequestError = RequestError; +//# sourceMappingURL=index.js.map -SemVer.prototype.toString = function () { - return this.version -} -SemVer.prototype.compare = function (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +/***/ }), - return this.compareMain(other) || this.comparePre(other) -} +/***/ 36234: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -SemVer.prototype.compareMain = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +"use strict"; - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) -} -SemVer.prototype.comparePre = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } +Object.defineProperty(exports, "__esModule", ({ value: true })); - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - var i = 0 - do { - var a = this.prerelease[i] - var b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) +var endpoint = __nccwpck_require__(59440); +var universalUserAgent = __nccwpck_require__(45030); +var isPlainObject = __nccwpck_require__(63287); +var nodeFetch = _interopDefault(__nccwpck_require__(80467)); +var requestError = __nccwpck_require__(10537); + +const VERSION = "5.6.2"; + +function getBufferResponse(response) { + return response.arrayBuffer(); } -SemVer.prototype.compareBuild = function (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) +function fetchWrapper(requestOptions) { + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + + if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); } - var i = 0 - do { - var a = this.build[i] - var b = other.build[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) + let headers = {}; + let status; + let url; + const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch; + return fetch(requestOptions.url, Object.assign({ + method: requestOptions.method, + body: requestOptions.body, + headers: requestOptions.headers, + redirect: requestOptions.redirect + }, // `requestOptions.request.agent` type is incompatible + // see https://github.com/octokit/types.ts/pull/264 + requestOptions.request)).then(async response => { + url = response.url; + status = response.status; + + for (const keyAndValue of response.headers) { + headers[keyAndValue[0]] = keyAndValue[1]; } - } while (++i) -} -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function (release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier) - this.inc('pre', identifier) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier) - } - this.inc('pre', identifier) - break + if ("deprecation" in headers) { + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); + const deprecationLink = matches && matches.pop(); + log.warn(`[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}`); + } - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) { - this.prerelease = [0] - } else { - var i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - this.prerelease.push(0) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0] - } - } else { - this.prerelease = [identifier, 0] - } - } - break + if (status === 204 || status === 205) { + return; + } // GitHub API returns 200 for HEAD requests - default: - throw new Error('invalid increment argument: ' + release) - } - this.format() - this.raw = this.version - return this -} -exports.inc = inc -function inc (version, release, loose, identifier) { - if (typeof (loose) === 'string') { - identifier = loose - loose = undefined - } + if (requestOptions.method === "HEAD") { + if (status < 400) { + return; + } - try { - return new SemVer(version, loose).inc(release, identifier).version - } catch (er) { - return null - } -} + throw new requestError.RequestError(response.statusText, status, { + response: { + url, + status, + headers, + data: undefined + }, + request: requestOptions + }); + } -exports.diff = diff -function diff (version1, version2) { - if (eq(version1, version2)) { - return null - } else { - var v1 = parse(version1) - var v2 = parse(version2) - var prefix = '' - if (v1.prerelease.length || v2.prerelease.length) { - prefix = 'pre' - var defaultResult = 'prerelease' + if (status === 304) { + throw new requestError.RequestError("Not modified", status, { + response: { + url, + status, + headers, + data: await getResponseData(response) + }, + request: requestOptions + }); } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return prefix + key - } - } + + if (status >= 400) { + const data = await getResponseData(response); + const error = new requestError.RequestError(toErrorMessage(data), status, { + response: { + url, + status, + headers, + data + }, + request: requestOptions + }); + throw error; } - return defaultResult // may be undefined - } -} -exports.compareIdentifiers = compareIdentifiers + return getResponseData(response); + }).then(data => { + return { + status, + url, + headers, + data + }; + }).catch(error => { + if (error instanceof requestError.RequestError) throw error; + throw new requestError.RequestError(error.message, 500, { + request: requestOptions + }); + }); +} -var numeric = /^[0-9]+$/ -function compareIdentifiers (a, b) { - var anum = numeric.test(a) - var bnum = numeric.test(b) +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); - if (anum && bnum) { - a = +a - b = +b + if (/application\/json/.test(contentType)) { + return response.json(); } - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); + } -exports.rcompareIdentifiers = rcompareIdentifiers -function rcompareIdentifiers (a, b) { - return compareIdentifiers(b, a) + return getBufferResponse(response); } -exports.major = major -function major (a, loose) { - return new SemVer(a, loose).major -} +function toErrorMessage(data) { + if (typeof data === "string") return data; // istanbul ignore else - just in case -exports.minor = minor -function minor (a, loose) { - return new SemVer(a, loose).minor -} + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + } -exports.patch = patch -function patch (a, loose) { - return new SemVer(a, loose).patch -} + return data.message; + } // istanbul ignore next - just in case -exports.compare = compare -function compare (a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)) -} -exports.compareLoose = compareLoose -function compareLoose (a, b) { - return compare(a, b, true) + return `Unknown error: ${JSON.stringify(data)}`; } -exports.compareBuild = compareBuild -function compareBuild (a, b, loose) { - var versionA = new SemVer(a, loose) - var versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} +function withDefaults(oldEndpoint, newDefaults) { + const endpoint = oldEndpoint.defaults(newDefaults); -exports.rcompare = rcompare -function rcompare (a, b, loose) { - return compare(b, a, loose) -} + const newApi = function (route, parameters) { + const endpointOptions = endpoint.merge(route, parameters); -exports.sort = sort -function sort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(a, b, loose) - }) -} + if (!endpointOptions.request || !endpointOptions.request.hook) { + return fetchWrapper(endpoint.parse(endpointOptions)); + } -exports.rsort = rsort -function rsort (list, loose) { - return list.sort(function (a, b) { - return exports.compareBuild(b, a, loose) - }) -} + const request = (route, parameters) => { + return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); + }; -exports.gt = gt -function gt (a, b, loose) { - return compare(a, b, loose) > 0 -} + Object.assign(request, { + endpoint, + defaults: withDefaults.bind(null, endpoint) + }); + return endpointOptions.request.hook(request, endpointOptions); + }; -exports.lt = lt -function lt (a, b, loose) { - return compare(a, b, loose) < 0 + return Object.assign(newApi, { + endpoint, + defaults: withDefaults.bind(null, endpoint) + }); } -exports.eq = eq -function eq (a, b, loose) { - return compare(a, b, loose) === 0 -} +const request = withDefaults(endpoint.endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}` + } +}); -exports.neq = neq -function neq (a, b, loose) { - return compare(a, b, loose) !== 0 -} +exports.request = request; +//# sourceMappingURL=index.js.map -exports.gte = gte -function gte (a, b, loose) { - return compare(a, b, loose) >= 0 -} -exports.lte = lte -function lte (a, b, loose) { - return compare(a, b, loose) <= 0 -} +/***/ }), -exports.cmp = cmp -function cmp (a, op, b, loose) { - switch (op) { - case '===': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a === b +/***/ 55375: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - case '!==': - if (typeof a === 'object') - a = a.version - if (typeof b === 'object') - b = b.version - return a !== b +"use strict"; - case '': - case '=': - case '==': - return eq(a, b, loose) - case '!=': - return neq(a, b, loose) +Object.defineProperty(exports, "__esModule", ({ value: true })); - case '>': - return gt(a, b, loose) +var core = __nccwpck_require__(76762); +var pluginRequestLog = __nccwpck_require__(68883); +var pluginPaginateRest = __nccwpck_require__(64193); +var pluginRestEndpointMethods = __nccwpck_require__(83044); - case '>=': - return gte(a, b, loose) +const VERSION = "18.12.0"; - case '<': - return lt(a, b, loose) +const Octokit = core.Octokit.plugin(pluginRequestLog.requestLog, pluginRestEndpointMethods.legacyRestEndpointMethods, pluginPaginateRest.paginateRest).defaults({ + userAgent: `octokit-rest.js/${VERSION}` +}); - case '<=': - return lte(a, b, loose) +exports.Octokit = Octokit; +//# sourceMappingURL=index.js.map - default: - throw new TypeError('Invalid operator: ' + op) - } -} -exports.Comparator = Comparator -function Comparator (comp, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +/***/ }), - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } +/***/ 65063: +/***/ ((module) => { - if (!(this instanceof Comparator)) { - return new Comparator(comp, options) - } +"use strict"; - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - debug('comp', this) -} +/***/ }), -var ANY = {} -Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var m = comp.match(r) +/***/ 52068: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - if (!m) { - throw new TypeError('Invalid comparator: ' + comp) - } +"use strict"; +/* module decorator */ module = __nccwpck_require__.nmd(module); - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } -} +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; -Comparator.prototype.toString = function () { - return this.value -} +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; -Comparator.prototype.test = function (version) { - debug('Comparator.test', version, this.options.loose) +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; - if (this.semver === ANY || version === ANY) { - return true - } +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); - return cmp(version, this.operator, this.semver, this.options) -} + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); -Comparator.prototype.intersects = function (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } + return value; + }, + enumerable: true, + configurable: true + }); +}; - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = __nccwpck_require__(86931); + } - var rangeTmp + const offset = isBackground ? 10 : 0; + const styles = {}; - if (this.operator === '') { - if (this.value === '') { - return true - } - rangeTmp = new Range(comp.value, options) - return satisfies(this.value, rangeTmp, options) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - rangeTmp = new Range(this.value, options) - return satisfies(comp.semver, rangeTmp, options) - } + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } - var sameDirectionIncreasing = - (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>') - var sameDirectionDecreasing = - (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<') - var sameSemVer = this.semver.version === comp.semver.version - var differentDirectionsInclusive = - (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<=') - var oppositeDirectionsLessThan = - cmp(this.semver, '<', comp.semver, options) && - ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')) - var oppositeDirectionsGreaterThan = - cmp(this.semver, '>', comp.semver, options) && - ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')) + return styles; +}; - return sameDirectionIncreasing || sameDirectionDecreasing || - (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan -} +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], -exports.Range = Range -function Range (range, options) { - if (!options || typeof options !== 'object') { - options = { - loose: !!options, - includePrerelease: false - } - } + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], - if (range instanceof Range) { - if (range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease) { - return range - } else { - return new Range(range.raw, options) - } - } + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; - if (range instanceof Comparator) { - return new Range(range.value, options) - } + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - if (!(this instanceof Range)) { - return new Range(range, options) - } + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease + group[styleName] = styles[styleName]; - // First, split based on boolean or || - this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { - return this.parseRange(range.trim()) - }, this).filter(function (c) { - // throw out any that are not relevant for whatever reason - return c.length - }) + codes.set(style[0], style[1]); + } - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) - } + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } - this.format() -} + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); -Range.prototype.format = function () { - this.range = this.set.map(function (comps) { - return comps.join(' ').trim() - }).join('||').trim() - return this.range -} + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; -Range.prototype.toString = function () { - return this.range + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; } -Range.prototype.parseRange = function (range) { - var loose = this.options.loose - range = range.trim() - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace) - debug('hyphen replace', range) - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) +/***/ }), - // normalize spaces - range = range.split(/\s+/).join(' ') +/***/ 83278: +/***/ ((module) => { - // At this point, the range is completely trimmed and - // ready to be split into comparators. +"use strict"; - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - var set = range.split(' ').map(function (comp) { - return parseComparator(comp, this.options) - }, this).join(' ').split(/\s+/) - if (this.options.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function (comp) { - return !!comp.match(compRe) - }) - } - set = set.map(function (comp) { - return new Comparator(comp, this.options) - }, this) - return set +function isArguments (thingy) { + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') } -Range.prototype.intersects = function (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } +var types = { + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} - return this.set.some(function (thisComparators) { - return ( - isSatisfiable(thisComparators, options) && - range.set.some(function (rangeComparators) { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every(function (thisComparator) { - return rangeComparators.every(function (rangeComparator) { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) +function addSchema (schema, arity) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) } -// take a set of comparators and determine whether there -// exists a version which can satisfy it -function isSatisfiable (comparators, options) { - var result = true - var remainingComparators = comparators.slice() - var testComparator = remainingComparators.pop() +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') + if (!args) throw missingRequiredArg(1, 'args') + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} - while (result && remainingComparators.length) { - result = remainingComparators.every(function (otherComparator) { - return testComparator.intersects(otherComparator, options) + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema, arity) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E'), arity) + addSchema(schema.replace(/E/, 'Z'), arity) + if (schema.length === 1) addSchema('', arity) + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) }) - - testComparator = remainingComparators.pop() + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching } +} - return result +function missingRequiredArg (num) { + return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) } -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators -function toComparators (range, options) { - return new Range(range, options).set.map(function (comp) { - return comp.map(function (c) { - return c.value - }).join(' ').trim().split(' ') - }) +function unknownType (num, type) { + return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) } -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator (comp, options) { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp +function invalidType (num, expectedTypes, value) { + var valueType + Object.keys(types).forEach(function (typeCode) { + if (types[typeCode].check(value)) valueType = types[typeCode].label + }) + return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + + englishList(expectedTypes) + ' but got ' + valueType) } -function isX (id) { - return !id || id.toLowerCase() === 'x' || id === '*' +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') } -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceTilde(comp, options) - }).join(' ') +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) } -function replaceTilde (comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, function (_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else if (pr) { - debug('replaceTilde pr', pr) - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } else { - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - - debug('tilde return', ret) - return ret - }) +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') } -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets (comp, options) { - return comp.trim().split(/\s+/).map(function (comp) { - return replaceCaret(comp, options) - }).join(' ') +function newException (code, msg) { + var e = new Error(msg) + e.code = code + if (Error.captureStackTrace) Error.captureStackTrace(e, validate) + return e } -function replaceCaret (comp, options) { - debug('caret', comp, options) - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - return comp.replace(r, function (_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr) - var ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' - } else if (isX(p)) { - if (M === '0') { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' - } else { - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + '-' + pr + - ' <' + (+M + 1) + '.0.0' - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1) - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0' - } - } else { - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0' - } - } - debug('caret return', ret) - return ret - }) -} +/***/ }), -function replaceXRanges (comp, options) { - debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map(function (comp) { - return replaceXRange(comp, options) - }).join(' ') -} +/***/ 11083: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -function replaceXRange (comp, options) { - comp = comp.trim() - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, function (ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - var xM = isX(M) - var xm = xM || isX(m) - var xp = xm || isX(p) - var anyX = xp +"use strict"; - if (gtlt === '=' && anyX) { - gtlt = '' - } +exports.TrackerGroup = __nccwpck_require__(60660) +exports.Tracker = __nccwpck_require__(8074) +exports.TrackerStream = __nccwpck_require__(31375) - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 +/***/ }), - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } +/***/ 10165: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - ret = gtlt + M + '.' + m + '.' + p + pr - } else if (xm) { - ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr - } else if (xp) { - ret = '>=' + M + '.' + m + '.0' + pr + - ' <' + M + '.' + (+m + 1) + '.0' + pr - } +"use strict"; - debug('xRange return', ret) +var EventEmitter = __nccwpck_require__(28614).EventEmitter +var util = __nccwpck_require__(31669) - return ret - }) +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name } +util.inherits(TrackerBase, EventEmitter) -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars (comp, options) { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') -} -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = '>=' + fM + '.0.0' - } else if (isX(fp)) { - from = '>=' + fM + '.' + fm + '.0' - } else { - from = '>=' + from - } +/***/ }), - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = '<' + (+tM + 1) + '.0.0' - } else if (isX(tp)) { - to = '<' + tM + '.' + (+tm + 1) + '.0' - } else if (tpr) { - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr - } else { - to = '<=' + to - } +/***/ 60660: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return (from + ' ' + to).trim() -} +"use strict"; -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function (version) { - if (!version) { - return false - } +var util = __nccwpck_require__(31669) +var TrackerBase = __nccwpck_require__(10165) +var Tracker = __nccwpck_require__(8074) +var TrackerStream = __nccwpck_require__(31375) - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) } - return false } -function testSet (set, version, options) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup } + return names.join('/') +} - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) } + toTest = toTest.parentGroup } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} - // Version has a -pre, but it's not one of the ones we like. - return false +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] } + return completed +} - return true +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) } -exports.satisfies = satisfies -function satisfies (version, range, options) { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) } -exports.maxSatisfying = maxSatisfying -function maxSatisfying (versions, range, options) { - var max = null - var maxSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) } -exports.minSatisfying = minSatisfying -function minSatisfying (versions, range, options) { - var min = null - var minSV = null - try { - var rangeObj = new Range(range, options) - } catch (er) { - return null +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) } - versions.forEach(function (v) { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' } }) - return min + return output } -exports.minVersion = minVersion -function minVersion (range, loose) { - range = new Range(range, loose) - - var minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } +/***/ }), - minver = null - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] +/***/ 31375: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - comparators.forEach(function (comparator) { - // Clone to avoid manipulating the comparator's semver object. - var compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!minver || gt(minver, compver)) { - minver = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error('Unexpected operation: ' + comparator.operator) - } - }) - } +"use strict"; - if (minver && range.test(minver)) { - return minver - } +var util = __nccwpck_require__(31669) +var stream = __nccwpck_require__(51642) +var delegate = __nccwpck_require__(61318) +var Tracker = __nccwpck_require__(8074) - return null +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) } +util.inherits(TrackerStream, stream.Transform) -exports.validRange = validRange -function validRange (range, options) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) } } -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr -function ltr (version, range, options) { - return outside(version, range, '<', options) -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr -function gtr (version, range, options) { - return outside(version, range, '>', options) +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() } -exports.outside = outside -function outside (version, range, hilo, options) { - version = new SemVer(version, options) - range = new Range(range, options) +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} - var gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') + .method('finish') - // If it satisifes the range it is not outside - if (satisfies(version, range, options)) { - return false - } - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. +/***/ }), - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i] +/***/ 8074: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - var high = null - var low = null +"use strict"; - comparators.forEach(function (comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) +var util = __nccwpck_require__(31669) +var TrackerBase = __nccwpck_require__(10165) - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo } -exports.prerelease = prerelease -function prerelease (version, options) { - var parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) } -exports.intersects = intersects -function intersects (r1, r2, options) { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2) +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) } -exports.coerce = coerce -function coerce (version, options) { - if (version instanceof SemVer) { - return version - } +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} - if (typeof version === 'number') { - version = String(version) - } - if (typeof version !== 'string') { - return null - } +/***/ }), - options = options || {} +/***/ 28912: +/***/ ((module) => { - var match = null - if (!options.rtl) { - match = version.match(re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - var next - while ((next = re[t.COERCERTL].exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next +"use strict"; + +module.exports = function(val) { + return Array.isArray(val) ? val : [val]; +}; + + +/***/ }), + +/***/ 33415: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Packages +var retrier = __nccwpck_require__(24347); + +function retry(fn, opts) { + function run(resolve, reject) { + var options = opts || {}; + var op; + + // Default `randomize` to true + if (!('randomize' in options)) { + options.randomize = true; + } + + op = retrier.operation(options); + + // We allow the user to abort retrying + // this makes sense in the cases where + // knowledge is obtained that retrying + // would be futile (e.g.: auth errors) + + function bail(err) { + reject(err || new Error('Aborted')); + } + + function onError(err, num) { + if (err.bail) { + bail(err); + return; + } + + if (!op.retry(err)) { + reject(op.mainError()); + } else if (options.onRetry) { + options.onRetry(err, num); } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } - // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 - } - if (match === null) { - return null + function runAttempt(num) { + var val; + + try { + val = fn(bail, num); + } catch (err) { + onError(err, num); + return; + } + + Promise.resolve(val) + .then(resolve) + .catch(function catchIt(err) { + onError(err, num); + }); + } + + op.attempt(runAttempt); } - return parse(match[2] + - '.' + (match[3] || '0') + - '.' + (match[4] || '0'), options) + return new Promise(run); } +module.exports = retry; + /***/ }), -/***/ 55003: +/***/ 83682: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var register = __nccwpck_require__(44670) +var addHook = __nccwpck_require__(5549) +var removeHook = __nccwpck_require__(6819) +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind +var bindable = bind.bind(bind) -const isMatch = __nccwpck_require__(15100) -const modifyValues = __nccwpck_require__(23432) +function bindApi (hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) + hook.api = { remove: removeHookRef } + hook.remove = removeHookRef -function modifyValue (val) { - if (typeof val === 'string') { - return val.trim() + ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind] + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) + }) +} + +function HookSingular () { + var singularHookName = 'h' + var singularHookState = { + registry: {} } + var singularHook = register.bind(null, singularHookState, singularHookName) + bindApi(singularHook, singularHookState, singularHookName) + return singularHook +} - return val +function HookCollection () { + var state = { + registry: {} + } + + var hook = register.bind(null, state) + bindApi(hook, state) + + return hook } -function conventionalCommitsFilter (commits) { - if (!Array.isArray(commits)) { - throw new TypeError('Expected an array') +var collectionHookDeprecationMessageDisplayed = false +function Hook () { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') + collectionHookDeprecationMessageDisplayed = true } + return HookCollection() +} - let ret = [] - const ignores = [] - const remove = [] - commits.forEach(function (commit) { - if (commit.revert) { - ignores.push(commit) - } +Hook.Singular = HookSingular.bind() +Hook.Collection = HookCollection.bind() - ret.push(commit) - }) +module.exports = Hook +// expose constructors as a named property for TypeScript +module.exports.Hook = Hook +module.exports.Singular = Hook.Singular +module.exports.Collection = Hook.Collection - // Filter out reverted commits - ret = ret.filter(function (commit) { - let ignoreThis = false - commit = commit.raw ? modifyValues(commit.raw, modifyValue) : modifyValues(commit, modifyValue) +/***/ }), - ignores.some(function (ignoreCommit) { - const ignore = modifyValues(ignoreCommit.revert, modifyValue) +/***/ 5549: +/***/ ((module) => { - ignoreThis = isMatch(commit, ignore) +module.exports = addHook; - if (ignoreThis) { - remove.push(ignoreCommit.hash) - } +function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; + } - return ignoreThis - }) + if (kind === "before") { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)); + }; + } - return !ignoreThis - }) + if (kind === "after") { + hook = function (method, options) { + var result; + return Promise.resolve() + .then(method.bind(null, options)) + .then(function (result_) { + result = result_; + return orig(result, options); + }) + .then(function () { + return result; + }); + }; + } - // Filter out the commits that reverted something otherwise keep the revert commits - ret = ret.filter(function (commit) { - return remove.indexOf(commit.hash) !== 0 - }) + if (kind === "error") { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options); + }); + }; + } - return ret + state.registry[name].push({ + hook: hook, + orig: orig, + }); } -module.exports = conventionalCommitsFilter - /***/ }), -/***/ 95898: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +/***/ 44670: +/***/ ((module) => { -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. +module.exports = register; -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; + if (!options) { + options = {}; + } -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options); + }, method)(); + } -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); + } -function isNumber(arg) { - return typeof arg === 'number'; + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); } -exports.isNumber = isNumber; -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; +/***/ }), -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; +/***/ 6819: +/***/ ((module) => { -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; +module.exports = removeHook; -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; +function removeHook(state, name, method) { + if (!state.registry[name]) { + return; + } -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; + var index = state.registry[name] + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; + if (index === -1) { + return; + } -function isFunction(arg) { - return typeof arg === 'function'; + state.registry[name].splice(index, 1); } -exports.isFunction = isFunction; -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; -exports.isBuffer = __nccwpck_require__(64293).Buffer.isBuffer; +/***/ }), -function objectToString(o) { - return Object.prototype.toString.call(o); -} +/***/ 44159: +/***/ ((module) => { +module.exports = { + trueFunc: function trueFunc(){ + return true; + }, + falseFunc: function falseFunc(){ + return false; + } +}; /***/ }), -/***/ 36863: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 78818: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.attributeRules = void 0; -var boolbase_1 = __nccwpck_require__(44159); -/** - * All reserved characters in a regex, used for escaping. - * - * Taken from XRegExp, (c) 2007-2020 Steven Levithan under the MIT license - * https://github.com/slevithan/xregexp/blob/95eeebeb8fac8754d54eafe2b4743661ac1cf028/src/xregexp.js#L794 - */ -var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g; -function escapeRegex(value) { - return value.replace(reChars, "\\$&"); -} -/** - * Attribute selectors - */ -exports.attributeRules = { - equals: function (next, data, _a) { - var adapter = _a.adapter; - var name = data.name; - var value = data.value; - if (data.ignoreCase) { - value = value.toLowerCase(); - return function (elem) { - var attr = adapter.getAttributeValue(elem, name); - return (attr != null && - attr.length === value.length && - attr.toLowerCase() === value && - next(elem)); - }; - } - return function (elem) { - return adapter.getAttributeValue(elem, name) === value && next(elem); - }; - }, - hyphen: function (next, data, _a) { - var adapter = _a.adapter; - var name = data.name; - var value = data.value; - var len = value.length; - if (data.ignoreCase) { - value = value.toLowerCase(); - return function hyphenIC(elem) { - var attr = adapter.getAttributeValue(elem, name); - return (attr != null && - (attr.length === len || attr.charAt(len) === "-") && - attr.substr(0, len).toLowerCase() === value && - next(elem)); - }; - } - return function hyphen(elem) { - var attr = adapter.getAttributeValue(elem, name); - return (attr != null && - (attr.length === len || attr.charAt(len) === "-") && - attr.substr(0, len) === value && - next(elem)); - }; - }, - element: function (next, _a, _b) { - var name = _a.name, value = _a.value, ignoreCase = _a.ignoreCase; - var adapter = _b.adapter; - if (/\s/.test(value)) { - return boolbase_1.falseFunc; - } - var regex = new RegExp("(?:^|\\s)" + escapeRegex(value) + "(?:$|\\s)", ignoreCase ? "i" : ""); - return function element(elem) { - var attr = adapter.getAttributeValue(elem, name); - return (attr != null && - attr.length >= value.length && - regex.test(attr) && - next(elem)); - }; - }, - exists: function (next, _a, _b) { - var name = _a.name; - var adapter = _b.adapter; - return function (elem) { return adapter.hasAttrib(elem, name) && next(elem); }; - }, - start: function (next, data, _a) { - var adapter = _a.adapter; - var name = data.name; - var value = data.value; - var len = value.length; - if (len === 0) { - return boolbase_1.falseFunc; - } - if (data.ignoreCase) { - value = value.toLowerCase(); - return function (elem) { - var attr = adapter.getAttributeValue(elem, name); - return (attr != null && - attr.length >= len && - attr.substr(0, len).toLowerCase() === value && - next(elem)); - }; - } - return function (elem) { - var _a; - return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.startsWith(value)) && - next(elem); - }; - }, - end: function (next, data, _a) { - var adapter = _a.adapter; - var name = data.name; - var value = data.value; - var len = -value.length; - if (len === 0) { - return boolbase_1.falseFunc; - } - if (data.ignoreCase) { - value = value.toLowerCase(); - return function (elem) { - var _a; - return ((_a = adapter - .getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.substr(len).toLowerCase()) === value && next(elem); - }; - } - return function (elem) { - var _a; - return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.endsWith(value)) && - next(elem); - }; - }, - any: function (next, data, _a) { - var adapter = _a.adapter; - var name = data.name, value = data.value; - if (value === "") { - return boolbase_1.falseFunc; - } - if (data.ignoreCase) { - var regex_1 = new RegExp(escapeRegex(value), "i"); - return function anyIC(elem) { - var attr = adapter.getAttributeValue(elem, name); - return (attr != null && - attr.length >= value.length && - regex_1.test(attr) && - next(elem)); - }; - } - return function (elem) { - var _a; - return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.includes(value)) && - next(elem); - }; - }, - not: function (next, data, _a) { - var adapter = _a.adapter; - var name = data.name; - var value = data.value; - if (value === "") { - return function (elem) { - return !!adapter.getAttributeValue(elem, name) && next(elem); - }; - } - else if (data.ignoreCase) { - value = value.toLowerCase(); - return function (elem) { - var attr = adapter.getAttributeValue(elem, name); - return ((attr == null || - attr.length !== value.length || - attr.toLowerCase() !== value) && - next(elem)); - }; - } - return function (elem) { - return adapter.getAttributeValue(elem, name) !== value && next(elem); - }; - }, -}; +const ansiStyles = __nccwpck_require__(52068); +const {stdout: stdoutColor, stderr: stderrColor} = __nccwpck_require__(59318); +const { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex +} = __nccwpck_require__(82415); +const {isArray} = Array; -/***/ }), +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = [ + 'ansi', + 'ansi', + 'ansi256', + 'ansi16m' +]; -/***/ 35030: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +const styles = Object.create(null); -"use strict"; +const applyOptions = (object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error('The `level` option should be an integer from 0 to 3'); + } -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; + // Detect level if not set manually + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === undefined ? colorLevel : options.level; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.compileToken = exports.compileUnsafe = exports.compile = void 0; -var css_what_1 = __nccwpck_require__(19218); -var boolbase_1 = __nccwpck_require__(44159); -var sort_1 = __importDefault(__nccwpck_require__(57320)); -var procedure_1 = __nccwpck_require__(47396); -var general_1 = __nccwpck_require__(45374); -var subselects_1 = __nccwpck_require__(15813); -/** - * Compiles a selector to an executable function. - * - * @param selector Selector to compile. - * @param options Compilation options. - * @param context Optional context for the selector. - */ -function compile(selector, options, context) { - var next = compileUnsafe(selector, options, context); - return subselects_1.ensureIsTag(next, options.adapter); -} -exports.compile = compile; -function compileUnsafe(selector, options, context) { - var token = typeof selector === "string" ? css_what_1.parse(selector, options) : selector; - return compileToken(token, options, context); -} -exports.compileUnsafe = compileUnsafe; -function includesScopePseudo(t) { - return (t.type === "pseudo" && - (t.name === "scope" || - (Array.isArray(t.data) && - t.data.some(function (data) { return data.some(includesScopePseudo); })))); + +class ChalkClass { + constructor(options) { + // eslint-disable-next-line no-constructor-return + return chalkFactory(options); + } } -var DESCENDANT_TOKEN = { type: "descendant" }; -var FLEXIBLE_DESCENDANT_TOKEN = { - type: "_flexibleDescendant", + +const chalkFactory = options => { + const chalk = {}; + applyOptions(chalk, options); + + chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_); + + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); + + chalk.template.constructor = () => { + throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.'); + }; + + chalk.template.Instance = ChalkClass; + + return chalk.template; }; -var SCOPE_TOKEN = { type: "pseudo", name: "scope", data: null }; -/* - * CSS 4 Spec (Draft): 3.3.1. Absolutizing a Scope-relative Selector - * http://www.w3.org/TR/selectors4/#absolutizing - */ -function absolutize(token, _a, context) { - var adapter = _a.adapter; - // TODO Use better check if the context is a document - var hasContext = !!(context === null || context === void 0 ? void 0 : context.every(function (e) { - var parent = adapter.isTag(e) && adapter.getParent(e); - return e === subselects_1.PLACEHOLDER_ELEMENT || (parent && adapter.isTag(parent)); - })); - for (var _i = 0, token_1 = token; _i < token_1.length; _i++) { - var t = token_1[_i]; - if (t.length > 0 && procedure_1.isTraversal(t[0]) && t[0].type !== "descendant") { - // Don't continue in else branch - } - else if (hasContext && !t.some(includesScopePseudo)) { - t.unshift(DESCENDANT_TOKEN); - } - else { - continue; - } - t.unshift(SCOPE_TOKEN); - } + +function Chalk(options) { + return chalkFactory(options); } -function compileToken(token, options, context) { - var _a; - token = token.filter(function (t) { return t.length > 0; }); - token.forEach(sort_1.default); - context = (_a = options.context) !== null && _a !== void 0 ? _a : context; - var isArrayContext = Array.isArray(context); - var finalContext = context && (Array.isArray(context) ? context : [context]); - absolutize(token, options, finalContext); - var shouldTestNextSiblings = false; - var query = token - .map(function (rules) { - if (rules.length >= 2) { - var first = rules[0], second = rules[1]; - if (first.type !== "pseudo" || first.name !== "scope") { - // Ignore - } - else if (isArrayContext && second.type === "descendant") { - rules[1] = FLEXIBLE_DESCENDANT_TOKEN; - } - else if (second.type === "adjacent" || - second.type === "sibling") { - shouldTestNextSiblings = true; - } - } - return compileRules(rules, options, finalContext); - }) - .reduce(reduceRules, boolbase_1.falseFunc); - query.shouldTestNextSiblings = shouldTestNextSiblings; - return query; + +for (const [styleName, style] of Object.entries(ansiStyles)) { + styles[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); + Object.defineProperty(this, styleName, {value: builder}); + return builder; + } + }; } -exports.compileToken = compileToken; -function compileRules(rules, options, context) { - var _a; - return rules.reduce(function (previous, rule) { - return previous === boolbase_1.falseFunc - ? boolbase_1.falseFunc - : general_1.compileGeneralSelector(previous, rule, options, context, compileToken); - }, (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase_1.trueFunc); + +styles.visible = { + get() { + const builder = createBuilder(this, this._styler, true); + Object.defineProperty(this, 'visible', {value: builder}); + return builder; + } +}; + +const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256']; + +for (const model of usedModels) { + styles[model] = { + get() { + const {level} = this; + return function (...arguments_) { + const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; } -function reduceRules(a, b) { - if (b === boolbase_1.falseFunc || a === boolbase_1.trueFunc) { - return a; - } - if (a === boolbase_1.falseFunc || b === boolbase_1.trueFunc) { - return b; - } - return function combine(elem) { - return a(elem) || b(elem); - }; + +for (const model of usedModels) { + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const {level} = this; + return function (...arguments_) { + const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; } +const proto = Object.defineProperties(() => {}, { + ...styles, + level: { + enumerable: true, + get() { + return this._generator.level; + }, + set(level) { + this._generator.level = level; + } + } +}); -/***/ }), +const createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === undefined) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; + } -/***/ 45374: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return { + open, + close, + openAll, + closeAll, + parent + }; +}; -"use strict"; +const createBuilder = (self, _styler, _isEmpty) => { + const builder = (...arguments_) => { + if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) { + // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}` + return applyStyle(builder, chalkTag(builder, ...arguments_)); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.compileGeneralSelector = void 0; -var attributes_1 = __nccwpck_require__(36863); -var pseudo_selectors_1 = __nccwpck_require__(89312); -/* - * All available rules - */ -function compileGeneralSelector(next, selector, options, context, compileToken) { - var adapter = options.adapter, equals = options.equals; - switch (selector.type) { - case "pseudo-element": - throw new Error("Pseudo-elements are not supported by css-select"); - case "attribute": - return attributes_1.attributeRules[selector.action](next, selector, options); - case "pseudo": - return pseudo_selectors_1.compilePseudoSelector(next, selector, options, context, compileToken); - // Tags - case "tag": - return function tag(elem) { - return adapter.getName(elem) === selector.name && next(elem); - }; - // Traversal - case "descendant": - if (options.cacheResults === false || - typeof WeakSet === "undefined") { - return function descendant(elem) { - var current = elem; - while ((current = adapter.getParent(current))) { - if (adapter.isTag(current) && next(current)) { - return true; - } - } - return false; - }; - } - // @ts-expect-error `ElementNode` is not extending object - // eslint-disable-next-line no-case-declarations - var isFalseCache_1 = new WeakSet(); - return function cachedDescendant(elem) { - var current = elem; - while ((current = adapter.getParent(current))) { - if (!isFalseCache_1.has(current)) { - if (adapter.isTag(current) && next(current)) { - return true; - } - isFalseCache_1.add(current); - } - } - return false; - }; - case "_flexibleDescendant": - // Include element itself, only used while querying an array - return function flexibleDescendant(elem) { - var current = elem; - do { - if (adapter.isTag(current) && next(current)) - return true; - } while ((current = adapter.getParent(current))); - return false; - }; - case "parent": - return function parent(elem) { - return adapter - .getChildren(elem) - .some(function (elem) { return adapter.isTag(elem) && next(elem); }); - }; - case "child": - return function child(elem) { - var parent = adapter.getParent(elem); - return parent != null && adapter.isTag(parent) && next(parent); - }; - case "sibling": - return function sibling(elem) { - var siblings = adapter.getSiblings(elem); - for (var i = 0; i < siblings.length; i++) { - var currentSibling = siblings[i]; - if (equals(elem, currentSibling)) - break; - if (adapter.isTag(currentSibling) && next(currentSibling)) { - return true; - } - } - return false; - }; - case "adjacent": - return function adjacent(elem) { - var siblings = adapter.getSiblings(elem); - var lastElement; - for (var i = 0; i < siblings.length; i++) { - var currentSibling = siblings[i]; - if (equals(elem, currentSibling)) - break; - if (adapter.isTag(currentSibling)) { - lastElement = currentSibling; - } - } - return !!lastElement && next(lastElement); - }; - case "universal": - return next; - } -} -exports.compileGeneralSelector = compileGeneralSelector; + // Single argument is hot path, implicit coercion is faster than anything + // eslint-disable-next-line no-implicit-coercion + return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' ')); + }; + // We alter the prototype because we must return a function, but there is + // no way to create a function with a different prototype + Object.setPrototypeOf(builder, proto); -/***/ }), + builder._generator = self; + builder._styler = _styler; + builder._isEmpty = _isEmpty; -/***/ 4508: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + return builder; +}; -"use strict"; +const applyStyle = (self, string) => { + if (self.level <= 0 || !string) { + return self._isEmpty ? '' : string; + } -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; + let styler = self._styler; + + if (styler === undefined) { + return string; + } + + const {openAll, closeAll} = styler; + if (string.indexOf('\u001B') !== -1) { + while (styler !== undefined) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + string = stringReplaceAll(string, styler.close, styler.open); + + styler = styler.parent; + } + } + + // We can move both next actions out of loop, because remaining actions in loop won't have + // any/visible effect on parts we add here. Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92 + const lfIndex = string.indexOf('\n'); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } + + return openAll + string + closeAll; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.aliases = exports.pseudos = exports.filters = exports.is = exports.selectOne = exports.selectAll = exports.prepareContext = exports._compileToken = exports._compileUnsafe = exports.compile = void 0; -var DomUtils = __importStar(__nccwpck_require__(11754)); -var boolbase_1 = __nccwpck_require__(44159); -var compile_1 = __nccwpck_require__(35030); -var subselects_1 = __nccwpck_require__(15813); -var defaultEquals = function (a, b) { return a === b; }; -var defaultOptions = { - adapter: DomUtils, - equals: defaultEquals, + +let template; +const chalkTag = (chalk, ...strings) => { + const [firstString] = strings; + + if (!isArray(firstString) || !isArray(firstString.raw)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return strings.join(' '); + } + + const arguments_ = strings.slice(1); + const parts = [firstString.raw[0]]; + + for (let i = 1; i < firstString.length; i++) { + parts.push( + String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'), + String(firstString.raw[i]) + ); + } + + if (template === undefined) { + template = __nccwpck_require__(20500); + } + + return template(chalk, parts.join('')); }; -function convertOptionFormats(options) { - var _a, _b, _c, _d; - /* - * We force one format of options to the other one. - */ - // @ts-expect-error Default options may have incompatible `Node` / `ElementNode`. - var opts = options !== null && options !== void 0 ? options : defaultOptions; - // @ts-expect-error Same as above. - (_a = opts.adapter) !== null && _a !== void 0 ? _a : (opts.adapter = DomUtils); - // @ts-expect-error `equals` does not exist on `Options` - (_b = opts.equals) !== null && _b !== void 0 ? _b : (opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals); - return opts; -} -function wrapCompile(func) { - return function addAdapter(selector, options, context) { - var opts = convertOptionFormats(options); - return func(selector, opts, context); - }; -} -/** - * Compiles the query, returns a function. - */ -exports.compile = wrapCompile(compile_1.compile); -exports._compileUnsafe = wrapCompile(compile_1.compileUnsafe); -exports._compileToken = wrapCompile(compile_1.compileToken); -function getSelectorFunc(searchFunc) { - return function select(query, elements, options) { - var opts = convertOptionFormats(options); - if (typeof query !== "function") { - query = compile_1.compileUnsafe(query, opts, elements); - } - var filteredElements = prepareContext(elements, opts.adapter, query.shouldTestNextSiblings); - return searchFunc(query, filteredElements, opts); - }; + +Object.defineProperties(Chalk.prototype, styles); + +const chalk = Chalk(); // eslint-disable-line new-cap +chalk.supportsColor = stdoutColor; +chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap +chalk.stderr.supportsColor = stderrColor; + +module.exports = chalk; + + +/***/ }), + +/***/ 20500: +/***/ ((module) => { + +"use strict"; + +const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; +const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; +const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; +const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; + +const ESCAPES = new Map([ + ['n', '\n'], + ['r', '\r'], + ['t', '\t'], + ['b', '\b'], + ['f', '\f'], + ['v', '\v'], + ['0', '\0'], + ['\\', '\\'], + ['e', '\u001B'], + ['a', '\u0007'] +]); + +function unescape(c) { + const u = c[0] === 'u'; + const bracket = c[1] === '{'; + + if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) { + return String.fromCharCode(parseInt(c.slice(1), 16)); + } + + if (u && bracket) { + return String.fromCodePoint(parseInt(c.slice(2, -1), 16)); + } + + return ESCAPES.get(c) || c; } -function prepareContext(elems, adapter, shouldTestNextSiblings) { - if (shouldTestNextSiblings === void 0) { shouldTestNextSiblings = false; } - /* - * Add siblings if the query requires them. - * See https://github.com/fb55/css-select/pull/43#issuecomment-225414692 - */ - if (shouldTestNextSiblings) { - elems = appendNextSiblings(elems, adapter); - } - return Array.isArray(elems) - ? adapter.removeSubsets(elems) - : adapter.getChildren(elems); + +function parseArguments(name, arguments_) { + const results = []; + const chunks = arguments_.trim().split(/\s*,\s*/g); + let matches; + + for (const chunk of chunks) { + const number = Number(chunk); + if (!Number.isNaN(number)) { + results.push(number); + } else if ((matches = chunk.match(STRING_REGEX))) { + results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); + } + } + + return results; } -exports.prepareContext = prepareContext; -function appendNextSiblings(elem, adapter) { - // Order matters because jQuery seems to check the children before the siblings - var elems = Array.isArray(elem) ? elem.slice(0) : [elem]; - for (var i = 0; i < elems.length; i++) { - var nextSiblings = subselects_1.getNextSiblings(elems[i], adapter); - elems.push.apply(elems, nextSiblings); - } - return elems; + +function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; + + const results = []; + let matches; + + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; + + if (matches[2]) { + const args = parseArguments(name, matches[2]); + results.push([name].concat(args)); + } else { + results.push([name]); + } + } + + return results; } -/** - * @template Node The generic Node type for the DOM adapter being used. - * @template ElementNode The Node type for elements for the DOM adapter being used. - * @param elems Elements to query. If it is an element, its children will be queried.. - * @param query can be either a CSS selector string or a compiled query function. - * @param [options] options for querying the document. - * @see compile for supported selector queries. - * @returns All matching elements. - * - */ -exports.selectAll = getSelectorFunc(function (query, elems, options) { - return query === boolbase_1.falseFunc || !elems || elems.length === 0 - ? [] - : options.adapter.findAll(query, elems); -}); -/** - * @template Node The generic Node type for the DOM adapter being used. - * @template ElementNode The Node type for elements for the DOM adapter being used. - * @param elems Elements to query. If it is an element, its children will be queried.. - * @param query can be either a CSS selector string or a compiled query function. - * @param [options] options for querying the document. - * @see compile for supported selector queries. - * @returns the first match, or null if there was no match. - */ -exports.selectOne = getSelectorFunc(function (query, elems, options) { - return query === boolbase_1.falseFunc || !elems || elems.length === 0 - ? null - : options.adapter.findOne(query, elems); -}); -/** - * Tests whether or not an element is matched by query. - * - * @template Node The generic Node type for the DOM adapter being used. - * @template ElementNode The Node type for elements for the DOM adapter being used. - * @param elem The element to test if it matches the query. - * @param query can be either a CSS selector string or a compiled query function. - * @param [options] options for querying the document. - * @see compile for supported selector queries. - * @returns - */ -function is(elem, query, options) { - var opts = convertOptionFormats(options); - return (typeof query === "function" ? query : compile_1.compile(query, opts))(elem); + +function buildStyle(chalk, styles) { + const enabled = {}; + + for (const layer of styles) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } + } + + let current = chalk; + for (const [styleName, styles] of Object.entries(enabled)) { + if (!Array.isArray(styles)) { + continue; + } + + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } + + current = styles.length > 0 ? current[styleName](...styles) : current[styleName]; + } + + return current; } -exports.is = is; -/** - * Alias for selectAll(query, elems, options). - * @see [compile] for supported selector queries. - */ -exports.default = exports.selectAll; -// Export filters, pseudos and aliases to allow users to supply their own. -var pseudo_selectors_1 = __nccwpck_require__(89312); -Object.defineProperty(exports, "filters", ({ enumerable: true, get: function () { return pseudo_selectors_1.filters; } })); -Object.defineProperty(exports, "pseudos", ({ enumerable: true, get: function () { return pseudo_selectors_1.pseudos; } })); -Object.defineProperty(exports, "aliases", ({ enumerable: true, get: function () { return pseudo_selectors_1.aliases; } })); + +module.exports = (chalk, temporary) => { + const styles = []; + const chunks = []; + let chunk = []; + + // eslint-disable-next-line max-params + temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => { + if (escapeCharacter) { + chunk.push(unescape(escapeCharacter)); + } else if (style) { + const string = chunk.join(''); + chunk = []; + chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); + styles.push({inverse, styles: parseStyle(style)}); + } else if (close) { + if (styles.length === 0) { + throw new Error('Found extraneous } in Chalk template literal'); + } + + chunks.push(buildStyle(chalk, styles)(chunk.join(''))); + chunk = []; + styles.pop(); + } else { + chunk.push(character); + } + }); + + chunks.push(chunk.join('')); + + if (styles.length > 0) { + const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; + throw new Error(errMessage); + } + + return chunks.join(''); +}; /***/ }), -/***/ 47396: -/***/ ((__unused_webpack_module, exports) => { +/***/ 82415: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTraversal = exports.procedure = void 0; -exports.procedure = { - universal: 50, - tag: 30, - attribute: 1, - pseudo: 0, - "pseudo-element": 0, - descendant: -1, - child: -1, - parent: -1, - sibling: -1, - adjacent: -1, - _flexibleDescendant: -1, + +const stringReplaceAll = (string, substring, replacer) => { + let index = string.indexOf(substring); + if (index === -1) { + return string; + } + + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ''; + do { + returnValue += string.substr(endIndex, index - endIndex) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); + + returnValue += string.substr(endIndex); + return returnValue; +}; + +const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => { + let endIndex = 0; + let returnValue = ''; + do { + const gotCR = string[index - 1] === '\r'; + returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix; + endIndex = index + 1; + index = string.indexOf('\n', endIndex); + } while (index !== -1); + + returnValue += string.substr(endIndex); + return returnValue; +}; + +module.exports = { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex }; -function isTraversal(t) { - return exports.procedure[t.type] < 0; -} -exports.isTraversal = isTraversal; /***/ }), -/***/ 24176: -/***/ ((__unused_webpack_module, exports) => { +/***/ 68929: +/***/ ((module) => { "use strict"; +/* eslint-disable babel/new-cap, xo/throw-new-error */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.aliases = void 0; -/** - * Aliases are pseudos that are expressed as selectors. - */ -exports.aliases = { - // Links - "any-link": ":is(a, area, link)[href]", - link: ":any-link:not(:visited)", - // Forms - // https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements - disabled: ":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )", - enabled: ":not(:disabled)", - checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)", - required: ":is(input, select, textarea)[required]", - optional: ":is(input, select, textarea):not([required])", - // JQuery extensions - // https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness - selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)", - checkbox: "[type=checkbox]", - file: "[type=file]", - password: "[type=password]", - radio: "[type=radio]", - reset: "[type=reset]", - image: "[type=image]", - submit: "[type=submit]", - parent: ":not(:empty)", - header: ":is(h1, h2, h3, h4, h5, h6)", - button: ":is(button, input[type=button])", - input: ":is(input, textarea, select, button)", - text: "input:is(:not([type!='']), [type=text])", +module.exports = function (str, pos) { + if (str === null || str === undefined) { + throw TypeError(); + } + + str = String(str); + + var size = str.length; + var i = pos ? Number(pos) : 0; + + if (Number.isNaN(i)) { + i = 0; + } + + if (i < 0 || i >= size) { + return undefined; + } + + var first = str.charCodeAt(i); + + if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { + var second = str.charCodeAt(i + 1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000; + } + } + + return first; }; /***/ }), -/***/ 51686: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 9558: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.filters = void 0; -var nth_check_1 = __importDefault(__nccwpck_require__(51260)); -var boolbase_1 = __nccwpck_require__(44159); -function getChildFunc(next, adapter) { - return function (elem) { - var parent = adapter.getParent(elem); - return parent != null && adapter.isTag(parent) && next(elem); +exports.addReviewCommentsDefaults = exports.addPullRequestDefaults = void 0; +const DEFAULT_BRANCH_NAME = 'code-suggestions'; +const DEFAULT_PRIMARY_BRANCH = 'main'; +const DEFAULT_PAGE_SIZE = 100; +/** + * Add defaults to GitHub Pull Request options. + * Preserves the empty string. + * For ESCMAScript, null/undefined values are preserved for required fields. + * Recommended with an object validation function to check empty strings and incorrect types. + * @param {PullRequestUserOptions} options the user-provided github pull request options + * @returns {CreatePullRequest} git hub context with defaults applied + */ +function addPullRequestDefaults(options) { + const pullRequestSettings = { + upstreamOwner: options.upstreamOwner, + upstreamRepo: options.upstreamRepo, + description: options.description, + title: options.title, + message: options.message, + force: options.force || false, + branch: typeof options.branch === 'string' ? options.branch : DEFAULT_BRANCH_NAME, + primary: typeof options.primary === 'string' + ? options.primary + : DEFAULT_PRIMARY_BRANCH, + maintainersCanModify: options.maintainersCanModify === false ? false : true, }; + return pullRequestSettings; } -exports.filters = { - contains: function (next, text, _a) { - var adapter = _a.adapter; - return function contains(elem) { - return next(elem) && adapter.getText(elem).includes(text); - }; - }, - icontains: function (next, text, _a) { - var adapter = _a.adapter; - var itext = text.toLowerCase(); - return function icontains(elem) { - return (next(elem) && - adapter.getText(elem).toLowerCase().includes(itext)); - }; - }, - // Location specific methods - "nth-child": function (next, rule, _a) { - var adapter = _a.adapter, equals = _a.equals; - var func = nth_check_1.default(rule); - if (func === boolbase_1.falseFunc) - return boolbase_1.falseFunc; - if (func === boolbase_1.trueFunc) - return getChildFunc(next, adapter); - return function nthChild(elem) { - var siblings = adapter.getSiblings(elem); - var pos = 0; - for (var i = 0; i < siblings.length; i++) { - if (equals(elem, siblings[i])) - break; - if (adapter.isTag(siblings[i])) { - pos++; - } - } - return func(pos) && next(elem); - }; - }, - "nth-last-child": function (next, rule, _a) { - var adapter = _a.adapter, equals = _a.equals; - var func = nth_check_1.default(rule); - if (func === boolbase_1.falseFunc) - return boolbase_1.falseFunc; - if (func === boolbase_1.trueFunc) - return getChildFunc(next, adapter); - return function nthLastChild(elem) { - var siblings = adapter.getSiblings(elem); - var pos = 0; - for (var i = siblings.length - 1; i >= 0; i--) { - if (equals(elem, siblings[i])) - break; - if (adapter.isTag(siblings[i])) { - pos++; - } - } - return func(pos) && next(elem); - }; - }, - "nth-of-type": function (next, rule, _a) { - var adapter = _a.adapter, equals = _a.equals; - var func = nth_check_1.default(rule); - if (func === boolbase_1.falseFunc) - return boolbase_1.falseFunc; - if (func === boolbase_1.trueFunc) - return getChildFunc(next, adapter); - return function nthOfType(elem) { - var siblings = adapter.getSiblings(elem); - var pos = 0; - for (var i = 0; i < siblings.length; i++) { - var currentSibling = siblings[i]; - if (equals(elem, currentSibling)) - break; - if (adapter.isTag(currentSibling) && - adapter.getName(currentSibling) === adapter.getName(elem)) { - pos++; - } - } - return func(pos) && next(elem); - }; - }, - "nth-last-of-type": function (next, rule, _a) { - var adapter = _a.adapter, equals = _a.equals; - var func = nth_check_1.default(rule); - if (func === boolbase_1.falseFunc) - return boolbase_1.falseFunc; - if (func === boolbase_1.trueFunc) - return getChildFunc(next, adapter); - return function nthLastOfType(elem) { - var siblings = adapter.getSiblings(elem); - var pos = 0; - for (var i = siblings.length - 1; i >= 0; i--) { - var currentSibling = siblings[i]; - if (equals(elem, currentSibling)) - break; - if (adapter.isTag(currentSibling) && - adapter.getName(currentSibling) === adapter.getName(elem)) { - pos++; - } - } - return func(pos) && next(elem); - }; - }, - // TODO determine the actual root element - root: function (next, _rule, _a) { - var adapter = _a.adapter; - return function (elem) { - var parent = adapter.getParent(elem); - return (parent == null || !adapter.isTag(parent)) && next(elem); - }; - }, - scope: function (next, rule, options, context) { - var equals = options.equals; - if (!context || context.length === 0) { - // Equivalent to :root - return exports.filters.root(next, rule, options); - } - if (context.length === 1) { - // NOTE: can't be unpacked, as :has uses this for side-effects - return function (elem) { return equals(context[0], elem) && next(elem); }; - } - return function (elem) { return context.includes(elem) && next(elem); }; - }, - hover: dynamicStatePseudo("isHovered"), - visited: dynamicStatePseudo("isVisited"), - active: dynamicStatePseudo("isActive"), -}; +exports.addPullRequestDefaults = addPullRequestDefaults; /** - * Dynamic state pseudos. These depend on optional Adapter methods. - * - * @param name The name of the adapter method to call. - * @returns Pseudo for the `filters` object. + * Format user input for pull request review comments + * @param options The user's options input for review comments + * @returns the formatted version of user input for pull request review comments */ -function dynamicStatePseudo(name) { - return function dynamicPseudo(next, _rule, _a) { - var adapter = _a.adapter; - var func = adapter[name]; - if (typeof func !== "function") { - return boolbase_1.falseFunc; - } - return function active(elem) { - return func(elem) && next(elem); - }; +function addReviewCommentsDefaults(options) { + const createReviewComment = { + repo: options.repo, + owner: options.owner, + pullNumber: options.pullNumber, + // if zero set as 0 + pageSize: options.pageSize === null || options.pageSize === undefined + ? DEFAULT_PAGE_SIZE + : options.pageSize, }; + return createReviewComment; } - +exports.addReviewCommentsDefaults = addReviewCommentsDefaults; +//# sourceMappingURL=default-options-handler.js.map /***/ }), -/***/ 89312: +/***/ 58021: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.compilePseudoSelector = exports.aliases = exports.pseudos = exports.filters = void 0; -/* - * Pseudo selectors - * - * Pseudo selectors are available in three forms: - * - * 1. Filters are called when the selector is compiled and return a function - * that has to return either false, or the results of `next()`. - * 2. Pseudos are called on execution. They have to return a boolean. - * 3. Subselects work like filters, but have an embedded selector that will be run separately. - * - * Filters are great if you want to do some pre-processing, or change the call order - * of `next()` and your code. - * Pseudos should be used to implement simple checks. +exports.branch = exports.createBranch = exports.existsBranchWithName = exports.getBranchHead = exports.createRef = void 0; +const logger_1 = __nccwpck_require__(58192); +const REF_PREFIX = 'refs/heads/'; +const DEFAULT_PRIMARY_BRANCH = 'main'; +/** + * Create a new branch reference with the ref prefix + * @param {string} branchName name of the branch */ -var boolbase_1 = __nccwpck_require__(44159); -var css_what_1 = __nccwpck_require__(19218); -var filters_1 = __nccwpck_require__(51686); -Object.defineProperty(exports, "filters", ({ enumerable: true, get: function () { return filters_1.filters; } })); -var pseudos_1 = __nccwpck_require__(8952); -Object.defineProperty(exports, "pseudos", ({ enumerable: true, get: function () { return pseudos_1.pseudos; } })); -var aliases_1 = __nccwpck_require__(24176); -Object.defineProperty(exports, "aliases", ({ enumerable: true, get: function () { return aliases_1.aliases; } })); -var subselects_1 = __nccwpck_require__(15813); -function compilePseudoSelector(next, selector, options, context, compileToken) { - var name = selector.name, data = selector.data; - if (Array.isArray(data)) { - return subselects_1.subselects[name](next, data, options, context, compileToken); +function createRef(branchName) { + return REF_PREFIX + branchName; +} +exports.createRef = createRef; +/** + * get branch commit HEAD SHA of a repository + * Throws an error if the branch cannot be found + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} origin The domain information of the remote origin repository + * @param {string} branch the name of the branch + * @returns {Promise} branch commit HEAD SHA + */ +async function getBranchHead(octokit, origin, branch) { + const branchData = (await octokit.repos.getBranch({ + owner: origin.owner, + repo: origin.repo, + branch, + })).data; + logger_1.logger.info(`Successfully found branch HEAD sha "${branchData.commit.sha}".`); + return branchData.commit.sha; +} +exports.getBranchHead = getBranchHead; +/** + * Determine if there is a branch with the provided name in the remote GitHub repository + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} remote The domain information of the remote repository + * @param {string} name The branch name to create on the repository + * @returns {Promise} if there is a branch already existing in the remote GitHub repository + */ +async function existsBranchWithName(octokit, remote, name) { + try { + const data = (await octokit.git.getRef({ + owner: remote.owner, + repo: remote.repo, + ref: `heads/${name}`, + })).data; + return data.ref ? true : false; } - if (name in aliases_1.aliases) { - if (data != null) { - throw new Error("Pseudo " + name + " doesn't have any arguments"); - } - // The alias has to be parsed here, to make sure options are respected. - var alias = css_what_1.parse(aliases_1.aliases[name], options); - return subselects_1.subselects.is(next, alias, options, context, compileToken); + catch (err) { + if (err.status === 404) + return false; + else + throw err; } - if (name in filters_1.filters) { - return filters_1.filters[name](next, data, options, context); +} +exports.existsBranchWithName = existsBranchWithName; +/** + * Create a branch on the remote repository if there is not an existing branch + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} remote The domain information of the remote origin repository + * @param {string} name The branch name to create on the origin repository + * @param {string} baseSha the sha that the base of the reference points to + * @param {boolean} duplicate whether there is an existing branch or not + * @returns {Promise} + */ +async function createBranch(octokit, remote, name, baseSha, duplicate) { + if (!duplicate) { + const refData = (await octokit.git.createRef({ + owner: remote.owner, + repo: remote.repo, + ref: createRef(name), + sha: baseSha, + })).data; + logger_1.logger.info(`Successfully created branch at ${refData.url}`); } - if (name in pseudos_1.pseudos) { - var pseudo_1 = pseudos_1.pseudos[name]; - pseudos_1.verifyPseudoArgs(pseudo_1, name, data); - return pseudo_1 === boolbase_1.falseFunc - ? boolbase_1.falseFunc - : next === boolbase_1.trueFunc - ? function (elem) { return pseudo_1(elem, options, data); } - : function (elem) { return pseudo_1(elem, options, data) && next(elem); }; + else { + logger_1.logger.info('Skipping branch creation step...'); } - throw new Error("unmatched pseudo-class :" + name); } -exports.compilePseudoSelector = compilePseudoSelector; - - -/***/ }), - -/***/ 8952: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.verifyPseudoArgs = exports.pseudos = void 0; -// While filters are precompiled, pseudos get called when they are needed -exports.pseudos = { - empty: function (elem, _a) { - var adapter = _a.adapter; - return !adapter.getChildren(elem).some(function (elem) { - // FIXME: `getText` call is potentially expensive. - return adapter.isTag(elem) || adapter.getText(elem) !== ""; - }); - }, - "first-child": function (elem, _a) { - var adapter = _a.adapter, equals = _a.equals; - var firstChild = adapter - .getSiblings(elem) - .find(function (elem) { return adapter.isTag(elem); }); - return firstChild != null && equals(elem, firstChild); - }, - "last-child": function (elem, _a) { - var adapter = _a.adapter, equals = _a.equals; - var siblings = adapter.getSiblings(elem); - for (var i = siblings.length - 1; i >= 0; i--) { - if (equals(elem, siblings[i])) - return true; - if (adapter.isTag(siblings[i])) - break; - } - return false; - }, - "first-of-type": function (elem, _a) { - var adapter = _a.adapter, equals = _a.equals; - var siblings = adapter.getSiblings(elem); - var elemName = adapter.getName(elem); - for (var i = 0; i < siblings.length; i++) { - var currentSibling = siblings[i]; - if (equals(elem, currentSibling)) - return true; - if (adapter.isTag(currentSibling) && - adapter.getName(currentSibling) === elemName) { - break; - } - } - return false; - }, - "last-of-type": function (elem, _a) { - var adapter = _a.adapter, equals = _a.equals; - var siblings = adapter.getSiblings(elem); - var elemName = adapter.getName(elem); - for (var i = siblings.length - 1; i >= 0; i--) { - var currentSibling = siblings[i]; - if (equals(elem, currentSibling)) - return true; - if (adapter.isTag(currentSibling) && - adapter.getName(currentSibling) === elemName) { - break; - } - } - return false; - }, - "only-of-type": function (elem, _a) { - var adapter = _a.adapter, equals = _a.equals; - var elemName = adapter.getName(elem); - return adapter - .getSiblings(elem) - .every(function (sibling) { - return equals(elem, sibling) || - !adapter.isTag(sibling) || - adapter.getName(sibling) !== elemName; - }); - }, - "only-child": function (elem, _a) { - var adapter = _a.adapter, equals = _a.equals; - return adapter - .getSiblings(elem) - .every(function (sibling) { return equals(elem, sibling) || !adapter.isTag(sibling); }); - }, -}; -function verifyPseudoArgs(func, name, subselect) { - if (subselect === null) { - if (func.length > 2) { - throw new Error("pseudo-selector :" + name + " requires an argument"); - } +exports.createBranch = createBranch; +/** + * Create a GitHub branch given a remote origin. + * Throws an exception if octokit fails, or if the base branch is invalid + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} origin The domain information of the remote origin repository + * @param {RepoDomain} upstream The domain information of the remote upstream repository + * @param {string} name The branch name to create on the origin repository + * @param {string} baseBranch the name of the branch to base the new branch off of. Default is main + * @returns {Promise} the base SHA for subsequent commits to be based off for the origin branch + */ +async function branch(octokit, origin, upstream, name, baseBranch = DEFAULT_PRIMARY_BRANCH) { + // create branch from primary branch HEAD SHA + try { + const baseSha = await getBranchHead(octokit, upstream, baseBranch); + const duplicate = await existsBranchWithName(octokit, origin, name); + await createBranch(octokit, origin, name, baseSha, duplicate); + return baseSha; } - else if (func.length === 2) { - throw new Error("pseudo-selector :" + name + " doesn't have any arguments"); + catch (err) { + logger_1.logger.error('Error when creating branch'); + throw err; } } -exports.verifyPseudoArgs = verifyPseudoArgs; - +exports.branch = branch; +//# sourceMappingURL=branch.js.map /***/ }), -/***/ 15813: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 4424: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; -}; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.subselects = exports.getNextSiblings = exports.ensureIsTag = exports.PLACEHOLDER_ELEMENT = void 0; -var boolbase_1 = __nccwpck_require__(44159); -var procedure_1 = __nccwpck_require__(47396); -/** Used as a placeholder for :has. Will be replaced with the actual element. */ -exports.PLACEHOLDER_ELEMENT = {}; -function ensureIsTag(next, adapter) { - if (next === boolbase_1.falseFunc) - return boolbase_1.falseFunc; - return function (elem) { return adapter.isTag(elem) && next(elem); }; +exports.commitAndPush = exports.updateRef = exports.createCommit = exports.createTree = exports.generateTreeObjects = void 0; +const logger_1 = __nccwpck_require__(58192); +/** + * Generate and return a GitHub tree object structure + * containing the target change data + * See https://developer.github.com/v3/git/trees/#tree-object + * @param {Changes} changes the set of repository changes + * @returns {TreeObject[]} The new GitHub changes + */ +function generateTreeObjects(changes) { + const tree = []; + changes.forEach((fileData, path) => { + if (fileData.content === null) { + // if no file content then file is deleted + tree.push({ + path, + mode: fileData.mode, + type: 'blob', + sha: null, + }); + } + else { + // update file with its content + tree.push({ + path, + mode: fileData.mode, + type: 'blob', + content: fileData.content, + }); + } + }); + return tree; } -exports.ensureIsTag = ensureIsTag; -function getNextSiblings(elem, adapter) { - var siblings = adapter.getSiblings(elem); - if (siblings.length <= 1) - return []; - var elemIndex = siblings.indexOf(elem); - if (elemIndex < 0 || elemIndex === siblings.length - 1) - return []; - return siblings.slice(elemIndex + 1).filter(adapter.isTag); +exports.generateTreeObjects = generateTreeObjects; +/** + * Upload and create a remote GitHub tree + * and resolves with the new tree SHA. + * Rejects if GitHub V3 API fails with the GitHub error response + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} origin the the remote repository to push changes to + * @param {string} refHead the base of the new commit(s) + * @param {TreeObject[]} tree the set of GitHub changes to upload + * @returns {Promise} the GitHub tree SHA + */ +async function createTree(octokit, origin, refHead, tree) { + const oldTreeSha = (await octokit.git.getCommit({ + owner: origin.owner, + repo: origin.repo, + commit_sha: refHead, + })).data.tree.sha; + logger_1.logger.info('Got the latest commit tree'); + const treeSha = (await octokit.git.createTree({ + owner: origin.owner, + repo: origin.repo, + tree, + base_tree: oldTreeSha, + })).data.sha; + logger_1.logger.info(`Successfully created a tree with the desired changes with SHA ${treeSha}`); + return treeSha; } -exports.getNextSiblings = getNextSiblings; -var is = function (next, token, options, context, compileToken) { - var opts = { - xmlMode: !!options.xmlMode, - adapter: options.adapter, - equals: options.equals, - }; - var func = compileToken(token, opts, context); - return function (elem) { return func(elem) && next(elem); }; -}; -/* - * :not, :has, :is and :matches have to compile selectors - * doing this in src/pseudos.ts would lead to circular dependencies, - * so we add them here +exports.createTree = createTree; +/** + * Create a commit with a repo snapshot SHA on top of the reference HEAD + * and resolves with the SHA of the commit. + * Rejects if GitHub V3 API fails with the GitHub error response + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} origin the the remote repository to push changes to + * @param {string} refHead the base of the new commit(s) + * @param {string} treeSha the tree SHA that this commit will point to + * @param {string} message the message of the new commit + * @returns {Promise} the new commit SHA */ -exports.subselects = { - is: is, - /** - * `:matches` is an alias for `:is`. - */ - matches: is, - not: function (next, token, options, context, compileToken) { - var opts = { - xmlMode: !!options.xmlMode, - adapter: options.adapter, - equals: options.equals, - }; - var func = compileToken(token, opts, context); - if (func === boolbase_1.falseFunc) - return next; - if (func === boolbase_1.trueFunc) - return boolbase_1.falseFunc; - return function not(elem) { - return !func(elem) && next(elem); - }; - }, - has: function (next, subselect, options, _context, compileToken) { - var adapter = options.adapter; - var opts = { - xmlMode: !!options.xmlMode, - adapter: adapter, - equals: options.equals, - }; - // @ts-expect-error Uses an array as a pointer to the current element (side effects) - var context = subselect.some(function (s) { - return s.some(procedure_1.isTraversal); - }) - ? [exports.PLACEHOLDER_ELEMENT] - : undefined; - var compiled = compileToken(subselect, opts, context); - if (compiled === boolbase_1.falseFunc) - return boolbase_1.falseFunc; - if (compiled === boolbase_1.trueFunc) { - return function (elem) { - return adapter.getChildren(elem).some(adapter.isTag) && next(elem); - }; - } - var hasElement = ensureIsTag(compiled, adapter); - var _a = compiled.shouldTestNextSiblings, shouldTestNextSiblings = _a === void 0 ? false : _a; - /* - * `shouldTestNextSiblings` will only be true if the query starts with - * a traversal (sibling or adjacent). That means we will always have a context. - */ - if (context) { - return function (elem) { - context[0] = elem; - var childs = adapter.getChildren(elem); - var nextElements = shouldTestNextSiblings - ? __spreadArray(__spreadArray([], childs), getNextSiblings(elem, adapter)) : childs; - return (next(elem) && adapter.existsOne(hasElement, nextElements)); - }; - } - return function (elem) { - return next(elem) && - adapter.existsOne(hasElement, adapter.getChildren(elem)); - }; - }, -}; - +async function createCommit(octokit, origin, refHead, treeSha, message) { + const commitData = (await octokit.git.createCommit({ + owner: origin.owner, + repo: origin.repo, + message, + tree: treeSha, + parents: [refHead], + })).data; + logger_1.logger.info(`Successfully created commit. See commit at ${commitData.url}`); + return commitData.sha; +} +exports.createCommit = createCommit; +/** + * Update a reference to a SHA + * Rejects if GitHub V3 API fails with the GitHub error response + * @param {Octokit} octokit The authenticated octokit instance + * @param {BranchDomain} origin the the remote branch to push changes to + * @param {string} newSha the ref to update the commit HEAD to + * @param {boolean} force to force the commit changes given refHead + * @returns {Promise} + */ +async function updateRef(octokit, origin, newSha, force) { + await octokit.git.updateRef({ + owner: origin.owner, + repo: origin.repo, + ref: `heads/${origin.branch}`, + sha: newSha, + force, + }); + logger_1.logger.info(`Successfully updated reference ${origin.branch} to ${newSha}`); +} +exports.updateRef = updateRef; +/** + * Given a set of changes, apply the commit(s) on top of the given branch's head and upload it to GitHub + * Rejects if GitHub V3 API fails with the GitHub error response + * @param {Octokit} octokit The authenticated octokit instance + * @param {string} refHead the base of the new commit(s) + * @param {Changes} changes the set of repository changes + * @param {RepoDomain} origin the the remote repository to push changes to + * @param {string} originBranchName the remote branch that will contain the new changes + * @param {string} commitMessage the message of the new commit + * @param {boolean} force to force the commit changes given refHead + * @returns {Promise} + */ +async function commitAndPush(octokit, refHead, changes, originBranch, commitMessage, force) { + try { + const tree = generateTreeObjects(changes); + const treeSha = await createTree(octokit, originBranch, refHead, tree); + const commitSha = await createCommit(octokit, originBranch, refHead, treeSha, commitMessage); + await updateRef(octokit, originBranch, commitSha, force); + } + catch (err) { + err.message = `Error while creating a tree and updating the ref: ${err.message}`; + logger_1.logger.error(err); + throw err; + } +} +exports.commitAndPush = commitAndPush; +//# sourceMappingURL=commit-and-push.js.map /***/ }), -/***/ 57320: +/***/ 67386: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -var procedure_1 = __nccwpck_require__(47396); -var attributes = { - exists: 10, - equals: 8, - not: 7, - start: 6, - end: 6, - any: 5, - hyphen: 4, - element: 4, -}; +exports.fork = void 0; +const logger_1 = __nccwpck_require__(58192); /** - * Sort the parts of the passed selector, - * as there is potential for optimization - * (some types of selectors are faster than others) + * Fork the GitHub owner's repository. + * Returns the fork owner and fork repo when the fork creation request to GitHub succeeds. + * Otherwise throws error. * - * @param arr Selector to sort + * If fork already exists no new fork is created, no error occurs, and the existing Fork data is returned + * with the `updated_at` + any historical repo changes. + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} upstream upstream repository information + * @returns {Promise} the forked repository name, as well as the owner of that fork */ -function sortByProcedure(arr) { - var procs = arr.map(getProcedure); - for (var i = 1; i < arr.length; i++) { - var procNew = procs[i]; - if (procNew < 0) - continue; - for (var j = i - 1; j >= 0 && procNew < procs[j]; j--) { - var token = arr[j + 1]; - arr[j + 1] = arr[j]; - arr[j] = token; - procs[j + 1] = procs[j]; - procs[j] = procNew; - } - } -} -exports.default = sortByProcedure; -function getProcedure(token) { - var proc = procedure_1.procedure[token.type]; - if (token.type === "attribute") { - proc = attributes[token.action]; - if (proc === attributes.equals && token.name === "id") { - // Prefer ID selectors (eg. #ID) - proc = 9; - } - if (token.ignoreCase) { - /* - * IgnoreCase adds some overhead, prefer "normal" token - * this is a binary operation, to ensure it's still an int - */ - proc >>= 1; - } +async function fork(octokit, upstream) { + try { + const forkedRepo = (await octokit.repos.createFork({ + owner: upstream.owner, + repo: upstream.repo, + })).data; + const origin = { + repo: forkedRepo.name, + owner: forkedRepo.owner.login, + }; + logger_1.logger.info(`Create fork request was successful for ${origin.owner}/${origin.repo}`); + return origin; } - else if (token.type === "pseudo") { - if (!token.data) { - proc = 3; - } - else if (token.name === "has" || token.name === "contains") { - proc = 0; // Expensive in any case - } - else if (Array.isArray(token.data)) { - // "matches" and "not" - proc = 0; - for (var i = 0; i < token.data.length; i++) { - // TODO better handling of complex selectors - if (token.data[i].length !== 1) - continue; - var cur = getProcedure(token.data[i][0]); - // Avoid executing :has or :contains - if (cur === 0) { - proc = 0; - break; - } - if (cur > proc) - proc = cur; - } - if (token.data.length > 1 && proc > 0) - proc -= 1; - } - else { - proc = 1; - } + catch (err) { + logger_1.logger.error('Error when forking'); + throw Error(err.toString()); } - return proc; } - +exports.fork = fork; +//# sourceMappingURL=fork.js.map /***/ }), -/***/ 19218: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 8831: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.stringify = exports.parse = void 0; -__exportStar(__nccwpck_require__(97751), exports); -var parse_1 = __nccwpck_require__(97751); -Object.defineProperty(exports, "parse", ({ enumerable: true, get: function () { return __importDefault(parse_1).default; } })); -var stringify_1 = __nccwpck_require__(70586); -Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return __importDefault(stringify_1).default; } })); - +exports.addLabels = void 0; +const logger_1 = __nccwpck_require__(58192); +/** + * Create a GitHub PR on the upstream organization's repo + * Throws an error if the GitHub API fails + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} upstream The upstream repository + * @param {BranchDomain} origin The remote origin information that contains the origin branch + * @param {number} issue_number The issue number to add labels to. Can also be a PR number + * @param {string[]} labels The list of labels to apply to the issue/pull request. Default is []. the funciton will no-op. + * @returns {Promise} The list of resulting labels after the addition of the given labels + */ +async function addLabels(octokit, upstream, origin, issue_number, labels) { + if (!labels || labels.length === 0) { + return []; + } + const labelsResponseData = (await octokit.issues.addLabels({ + owner: upstream.owner, + repo: origin.repo, + issue_number: issue_number, + labels: labels, + })).data; + logger_1.logger.info(`Successfully added labels ${labels} to issue: ${issue_number}`); + return labelsResponseData.map(l => l.name); +} +exports.addLabels = addLabels; +//# sourceMappingURL=labels.js.map /***/ }), -/***/ 97751: -/***/ (function(__unused_webpack_module, exports) { +/***/ 24461: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTraversal = void 0; -var reName = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/; -var reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi; -var actionTypes = new Map([ - ["~", "element"], - ["^", "start"], - ["$", "end"], - ["*", "any"], - ["!", "not"], - ["|", "hyphen"], -]); -var Traversals = { - ">": "child", - "<": "parent", - "~": "sibling", - "+": "adjacent", -}; -var attribSelectors = { - "#": ["id", "equals"], - ".": ["class", "element"], -}; -// Pseudos, whose data property is parsed as well. -var unpackPseudos = new Set([ - "has", - "not", - "matches", - "is", - "where", - "host", - "host-context", -]); -var traversalNames = new Set(__spreadArray([ - "descendant" -], Object.keys(Traversals).map(function (k) { return Traversals[k]; }), true)); -/** - * Attributes that are case-insensitive in HTML. - * - * @private - * @see https://html.spec.whatwg.org/multipage/semantics-other.html#case-sensitivity-of-selectors - */ -var caseInsensitiveAttributes = new Set([ - "accept", - "accept-charset", - "align", - "alink", - "axis", - "bgcolor", - "charset", - "checked", - "clear", - "codetype", - "color", - "compact", - "declare", - "defer", - "dir", - "direction", - "disabled", - "enctype", - "face", - "frame", - "hreflang", - "http-equiv", - "lang", - "language", - "link", - "media", - "method", - "multiple", - "nohref", - "noresize", - "noshade", - "nowrap", - "readonly", - "rel", - "rev", - "rules", - "scope", - "scrolling", - "selected", - "shape", - "target", - "text", - "type", - "valign", - "valuetype", - "vlink", -]); +exports.openPullRequest = void 0; +const logger_1 = __nccwpck_require__(58192); +const DEFAULT_PRIMARY = 'main'; /** - * Checks whether a specific selector is a traversal. - * This is useful eg. in swapping the order of elements that - * are not traversals. - * - * @param selector Selector to check. + * Create a GitHub PR on the upstream organization's repo + * Throws an error if the GitHub API fails + * @param {Octokit} octokit The authenticated octokit instance + * @param {RepoDomain} upstream The upstream repository + * @param {BranchDomain} origin The remote origin information that contains the origin branch + * @param {Description} description The pull request title and detailed description + * @param {boolean} maintainersCanModify Whether or not maintainers can modify the pull request. Default is true + * @param {string} upstreamPrimary The upstream repository's primary branch. Default is main. + * @param draft Open a DRAFT pull request. Defaults to false. + * @returns {Promise} */ -function isTraversal(selector) { - return traversalNames.has(selector.type); -} -exports.isTraversal = isTraversal; -var stripQuotesFromPseudos = new Set(["contains", "icontains"]); -var quotes = new Set(['"', "'"]); -// Unescape function taken from https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L152 -function funescape(_, escaped, escapedWhitespace) { - var high = parseInt(escaped, 16) - 0x10000; - // NaN means non-codepoint - return high !== high || escapedWhitespace - ? escaped - : high < 0 - ? // BMP codepoint - String.fromCharCode(high + 0x10000) - : // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00); +async function openPullRequest(octokit, upstream, origin, description, maintainersCanModify = true, upstreamPrimary = DEFAULT_PRIMARY, draft = false) { + const head = `${origin.owner}:${origin.branch}`; + const existingPullRequest = (await octokit.pulls.list({ + owner: upstream.owner, + repo: origin.repo, + head, + })).data.find(pr => pr.head.label === head); + if (existingPullRequest) { + logger_1.logger.info(`Found existing pull request for reference ${origin.owner}:${origin.branch}. Skipping creating a new pull request.`); + return existingPullRequest.number; + } + const pullResponseData = (await octokit.pulls.create({ + owner: upstream.owner, + repo: origin.repo, + title: description.title, + head: `${origin.owner}:${origin.branch}`, + base: upstreamPrimary, + body: description.body, + maintainer_can_modify: maintainersCanModify, + draft: draft, + })).data; + logger_1.logger.info(`Successfully opened pull request available at url: ${pullResponseData.url}.`); + return pullResponseData.number; } -function unescapeCSS(str) { - return str.replace(reEscape, funescape); +exports.openPullRequest = openPullRequest; +//# sourceMappingURL=open-pull-request.js.map + +/***/ }), + +/***/ 43102: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getPullRequestHunks = exports.getCurrentPullRequestPatches = exports.createPullRequestReview = exports.makeInlineSuggestions = exports.buildReviewComments = exports.buildSummaryComment = void 0; +const logger_1 = __nccwpck_require__(58192); +const diff_utils_1 = __nccwpck_require__(15276); +const hunk_utils_1 = __nccwpck_require__(26381); +function hunkErrorMessage(hunk) { + return ` * lines ${hunk.oldStart}-${hunk.oldEnd}`; } -function isWhitespace(c) { - return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r"; +function fileErrorMessage(filename, hunks) { + return `* ${filename}\n` + hunks.map(hunkErrorMessage).join('\n'); } /** - * Parses `selector`, optionally with the passed `options`. - * - * @param selector Selector to parse. - * @param options Options for parsing. - * @returns Returns a two-dimensional array. - * The first dimension represents selectors separated by commas (eg. `sub1, sub2`), - * the second contains the relevant tokens for that selector. + * Build an error message based on invalid hunks. + * Returns an empty string if the provided hunks are empty. + * @param invalidHunks a map of filename to hunks that are not suggestable */ -function parse(selector, options) { - var subselects = []; - var endIndex = parseSelector(subselects, "" + selector, options, 0); - if (endIndex < selector.length) { - throw new Error("Unmatched selector: " + selector.slice(endIndex)); +function buildSummaryComment(invalidHunks) { + if (invalidHunks.size === 0) { + return ''; } - return subselects; + return ('Some suggestions could not be made:\n' + + Array.from(invalidHunks, ([filename, hunks]) => fileErrorMessage(filename, hunks)).join('\n')); } -exports.default = parse; -function parseSelector(subselects, selector, options, selectorIndex) { - var _a, _b; - if (options === void 0) { options = {}; } - var tokens = []; - var sawWS = false; - function getName(offset) { - var match = selector.slice(selectorIndex + offset).match(reName); - if (!match) { - throw new Error("Expected name, found " + selector.slice(selectorIndex)); - } - var name = match[0]; - selectorIndex += offset + name.length; - return unescapeCSS(name); +exports.buildSummaryComment = buildSummaryComment; +const COMFORT_PREVIEW_HEADER = 'application/vnd.github.comfort-fade-preview+json'; +/** + * Convert the patch suggestions into GitHub parameter objects. + * Use this to generate review comments + * For information see: + * https://developer.github.com/v3/pulls/comments/#create-a-review-comment-for-a-pull-request + * @param suggestions + */ +function buildReviewComments(suggestions) { + const fileComments = []; + suggestions.forEach((hunks, fileName) => { + hunks.forEach(hunk => { + const newContent = hunk.newContent.join('\n'); + if (hunk.oldStart === hunk.oldEnd) { + const singleComment = { + path: fileName, + body: `\`\`\`suggestion\n${newContent}\n\`\`\``, + line: hunk.oldEnd, + side: 'RIGHT', + }; + fileComments.push(singleComment); + } + else { + const comment = { + path: fileName, + body: `\`\`\`suggestion\n${newContent}\n\`\`\``, + start_line: hunk.oldStart, + line: hunk.oldEnd, + side: 'RIGHT', + start_side: 'RIGHT', + }; + fileComments.push(comment); + } + }); + }); + return fileComments; +} +exports.buildReviewComments = buildReviewComments; +/** + * Make a request to GitHub to make review comments + * @param octokit an authenticated octokit instance + * @param suggestions code suggestions patches + * @param remote the repository domain + * @param pullNumber the pull request number to make a review on + */ +async function makeInlineSuggestions(octokit, suggestions, outOfScopeSuggestions, remote, pullNumber) { + const comments = buildReviewComments(suggestions); + if (!comments.length) { + logger_1.logger.info('No valid suggestions to make'); } - function stripWhitespace(offset) { - while (isWhitespace(selector.charAt(selectorIndex + offset))) - offset++; - selectorIndex += offset; + if (!comments.length && !outOfScopeSuggestions.size) { + logger_1.logger.info('No suggestions were generated. Exiting...'); + return null; } - function isEscaped(pos) { - var slashCount = 0; - while (selector.charAt(--pos) === "\\") - slashCount++; - return (slashCount & 1) === 1; + const summaryComment = buildSummaryComment(outOfScopeSuggestions); + if (summaryComment) { + logger_1.logger.warn('Some suggestions could not be made'); } - function ensureNotTraversal() { - if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) { - throw new Error("Did not expect successive traversals."); - } + // apply the suggestions to the latest sha + // the latest Pull Request hunk range includes + // all previous commit valid hunk ranges + const headSha = (await octokit.pulls.get({ + owner: remote.owner, + repo: remote.repo, + pull_number: pullNumber, + })).data.head.sha; + const reviewNumber = (await octokit.pulls.createReview({ + owner: remote.owner, + repo: remote.repo, + pull_number: pullNumber, + commit_id: headSha, + event: 'COMMENT', + body: summaryComment, + headers: { accept: COMFORT_PREVIEW_HEADER }, + // Octokit type definitions doesn't support mulitiline comments, but the GitHub API does + comments: comments, + })).data.id; + logger_1.logger.info(`Successfully created a review on pull request: ${pullNumber}.`); + return reviewNumber; +} +exports.makeInlineSuggestions = makeInlineSuggestions; +/** + * Comment on a Pull Request + * @param {Octokit} octokit authenticated octokit isntance + * @param {RepoDomain} remote the Pull Request repository + * @param {number} pullNumber the Pull Request number + * @param {number} pageSize the number of files to comment on // TODO pagination + * @param {Map} diffContents the old and new contents of the files to suggest + * @returns the created review's id, or null if no review was made + */ +async function createPullRequestReview(octokit, remote, pullNumber, pageSize, diffContents) { + try { + // get the hunks from the pull request + const pullRequestHunks = await exports.getPullRequestHunks(octokit, remote, pullNumber, pageSize); + // get the hunks from the suggested change + const allSuggestedHunks = typeof diffContents === 'string' + ? diff_utils_1.parseAllHunks(diffContents) + : hunk_utils_1.getRawSuggestionHunks(diffContents); + // split hunks by commentable and uncommentable + const { validHunks, invalidHunks } = hunk_utils_1.partitionSuggestedHunksByScope(pullRequestHunks, allSuggestedHunks); + // create pull request review + const reviewNumber = await exports.makeInlineSuggestions(octokit, validHunks, invalidHunks, remote, pullNumber); + return reviewNumber; } - stripWhitespace(0); - while (selector !== "") { - var firstChar = selector.charAt(selectorIndex); - if (isWhitespace(firstChar)) { - sawWS = true; - stripWhitespace(1); - } - else if (firstChar in Traversals) { - ensureNotTraversal(); - tokens.push({ type: Traversals[firstChar] }); - sawWS = false; - stripWhitespace(1); - } - else if (firstChar === ",") { - if (tokens.length === 0) { - throw new Error("Empty sub-selector"); - } - subselects.push(tokens); - tokens = []; - sawWS = false; - stripWhitespace(1); - } - else if (selector.startsWith("/*", selectorIndex)) { - var endIndex = selector.indexOf("*/", selectorIndex + 2); - if (endIndex < 0) { - throw new Error("Comment was not terminated"); - } - selectorIndex = endIndex + 2; + catch (err) { + logger_1.logger.error('Failed to suggest'); + throw err; + } +} +exports.createPullRequestReview = createPullRequestReview; +/** + * For a pull request, get each remote file's patch text asynchronously + * Also get the list of files whose patch data could not be returned + * @param {Octokit} octokit the authenticated octokit instance + * @param {RepoDomain} remote the remote repository domain information + * @param {number} pullNumber the pull request number + * @param {number} pageSize the number of results to return per page + * @returns {Promise>} the stringified patch data for each file and the list of files whose patch data could not be resolved + */ +async function getCurrentPullRequestPatches(octokit, remote, pullNumber, pageSize) { + // TODO: support pagination + const filesMissingPatch = []; + const files = (await octokit.pulls.listFiles({ + owner: remote.owner, + repo: remote.repo, + pull_number: pullNumber, + per_page: pageSize, + })).data; + const patches = new Map(); + if (files.length === 0) { + logger_1.logger.error(`0 file results have returned from list files query for Pull Request #${pullNumber}. Cannot make suggestions on an empty Pull Request`); + throw Error('Empty Pull Request'); + } + files.forEach(file => { + if (file.patch === undefined) { + // files whose patch is too large do not return the patch text by default + // TODO handle file patches that are too large + logger_1.logger.warn(`File ${file.filename} may have a patch that is too large to display patch object.`); + filesMissingPatch.push(file.filename); } else { - if (sawWS) { - ensureNotTraversal(); - tokens.push({ type: "descendant" }); - sawWS = false; - } - if (firstChar in attribSelectors) { - var _c = attribSelectors[firstChar], name_1 = _c[0], action = _c[1]; - tokens.push({ - type: "attribute", - name: name_1, - action: action, - value: getName(1), - namespace: null, - // TODO: Add quirksMode option, which makes `ignoreCase` `true` for HTML. - ignoreCase: options.xmlMode ? null : false, - }); - } - else if (firstChar === "[") { - stripWhitespace(1); - // Determine attribute name and namespace - var namespace = null; - if (selector.charAt(selectorIndex) === "|") { - namespace = ""; - selectorIndex += 1; - } - if (selector.startsWith("*|", selectorIndex)) { - namespace = "*"; - selectorIndex += 2; - } - var name_2 = getName(0); - if (namespace === null && - selector.charAt(selectorIndex) === "|" && - selector.charAt(selectorIndex + 1) !== "=") { - namespace = name_2; - name_2 = getName(1); - } - if ((_a = options.lowerCaseAttributeNames) !== null && _a !== void 0 ? _a : !options.xmlMode) { - name_2 = name_2.toLowerCase(); - } - stripWhitespace(0); - // Determine comparison operation - var action = "exists"; - var possibleAction = actionTypes.get(selector.charAt(selectorIndex)); - if (possibleAction) { - action = possibleAction; - if (selector.charAt(selectorIndex + 1) !== "=") { - throw new Error("Expected `=`"); - } - stripWhitespace(2); - } - else if (selector.charAt(selectorIndex) === "=") { - action = "equals"; - stripWhitespace(1); - } - // Determine value - var value = ""; - var ignoreCase = null; - if (action !== "exists") { - if (quotes.has(selector.charAt(selectorIndex))) { - var quote = selector.charAt(selectorIndex); - var sectionEnd = selectorIndex + 1; - while (sectionEnd < selector.length && - (selector.charAt(sectionEnd) !== quote || - isEscaped(sectionEnd))) { - sectionEnd += 1; - } - if (selector.charAt(sectionEnd) !== quote) { - throw new Error("Attribute value didn't end"); - } - value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd)); - selectorIndex = sectionEnd + 1; - } - else { - var valueStart = selectorIndex; - while (selectorIndex < selector.length && - ((!isWhitespace(selector.charAt(selectorIndex)) && - selector.charAt(selectorIndex) !== "]") || - isEscaped(selectorIndex))) { - selectorIndex += 1; - } - value = unescapeCSS(selector.slice(valueStart, selectorIndex)); - } - stripWhitespace(0); - // See if we have a force ignore flag - var forceIgnore = selector.charAt(selectorIndex); - // If the forceIgnore flag is set (either `i` or `s`), use that value - if (forceIgnore === "s" || forceIgnore === "S") { - ignoreCase = false; - stripWhitespace(1); - } - else if (forceIgnore === "i" || forceIgnore === "I") { - ignoreCase = true; - stripWhitespace(1); - } - } - // If `xmlMode` is set, there are no rules; otherwise, use the `caseInsensitiveAttributes` list. - if (!options.xmlMode) { - // TODO: Skip this for `exists`, as there is no value to compare to. - ignoreCase !== null && ignoreCase !== void 0 ? ignoreCase : (ignoreCase = caseInsensitiveAttributes.has(name_2)); - } - if (selector.charAt(selectorIndex) !== "]") { - throw new Error("Attribute selector didn't terminate"); - } - selectorIndex += 1; - var attributeSelector = { - type: "attribute", - name: name_2, - action: action, - value: value, - namespace: namespace, - ignoreCase: ignoreCase, - }; - tokens.push(attributeSelector); - } - else if (firstChar === ":") { - if (selector.charAt(selectorIndex + 1) === ":") { - tokens.push({ - type: "pseudo-element", - name: getName(2).toLowerCase(), - }); - continue; - } - var name_3 = getName(1).toLowerCase(); - var data = null; - if (selector.charAt(selectorIndex) === "(") { - if (unpackPseudos.has(name_3)) { - if (quotes.has(selector.charAt(selectorIndex + 1))) { - throw new Error("Pseudo-selector " + name_3 + " cannot be quoted"); - } - data = []; - selectorIndex = parseSelector(data, selector, options, selectorIndex + 1); - if (selector.charAt(selectorIndex) !== ")") { - throw new Error("Missing closing parenthesis in :" + name_3 + " (" + selector + ")"); - } - selectorIndex += 1; - } - else { - selectorIndex += 1; - var start = selectorIndex; - var counter = 1; - for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) { - if (selector.charAt(selectorIndex) === "(" && - !isEscaped(selectorIndex)) { - counter++; - } - else if (selector.charAt(selectorIndex) === ")" && - !isEscaped(selectorIndex)) { - counter--; - } - } - if (counter) { - throw new Error("Parenthesis not matched"); - } - data = selector.slice(start, selectorIndex - 1); - if (stripQuotesFromPseudos.has(name_3)) { - var quot = data.charAt(0); - if (quot === data.slice(-1) && quotes.has(quot)) { - data = data.slice(1, -1); - } - data = unescapeCSS(data); - } - } - } - tokens.push({ type: "pseudo", name: name_3, data: data }); - } - else { - var namespace = null; - var name_4 = void 0; - if (firstChar === "*") { - selectorIndex += 1; - name_4 = "*"; - } - else if (reName.test(selector.slice(selectorIndex))) { - if (selector.charAt(selectorIndex) === "|") { - namespace = ""; - selectorIndex += 1; - } - name_4 = getName(0); - } - else { - /* - * We have finished parsing the selector. - * Remove descendant tokens at the end if they exist, - * and return the last index, so that parsing can be - * picked up from here. - */ - if (tokens.length && - tokens[tokens.length - 1].type === "descendant") { - tokens.pop(); - } - addToken(subselects, tokens); - return selectorIndex; - } - if (selector.charAt(selectorIndex) === "|") { - namespace = name_4; - if (selector.charAt(selectorIndex + 1) === "*") { - name_4 = "*"; - selectorIndex += 2; - } - else { - name_4 = getName(1); - } - } - if (name_4 === "*") { - tokens.push({ type: "universal", namespace: namespace }); - } - else { - if ((_b = options.lowerCaseTags) !== null && _b !== void 0 ? _b : !options.xmlMode) { - name_4 = name_4.toLowerCase(); - } - tokens.push({ type: "tag", name: name_4, namespace: namespace }); - } - } + patches.set(file.filename, file.patch); } + }); + if (patches.size === 0) { + logger_1.logger.warn('0 patches have been returned. This could be because the patch results were too large to return.'); } - addToken(subselects, tokens); - return selectorIndex; + return { patches, filesMissingPatch }; } -function addToken(subselects, tokens) { - if (subselects.length > 0 && tokens.length === 0) { - throw new Error("Empty sub-selector"); +exports.getCurrentPullRequestPatches = getCurrentPullRequestPatches; +/** + * For a pull request, get each remote file's current patch range to identify the scope of each patch as a Map. + * @param {Octokit} octokit the authenticated octokit instance + * @param {RepoDomain} remote the remote repository domain information + * @param {number} pullNumber the pull request number + * @param {number} pageSize the number of files to return per pull request list files query + * @returns {Promise>} the scope of each file in the pull request + */ +async function getPullRequestHunks(octokit, remote, pullNumber, pageSize) { + const files = (await octokit.pulls.listFiles({ + owner: remote.owner, + repo: remote.repo, + pull_number: pullNumber, + per_page: pageSize, + })).data; + const pullRequestHunks = new Map(); + if (files.length === 0) { + logger_1.logger.error(`0 file results have returned from list files query for Pull Request #${pullNumber}. Cannot make suggestions on an empty Pull Request`); + throw Error('Empty Pull Request'); } - subselects.push(tokens); + files.forEach(file => { + if (file.patch === undefined) { + // files whose patch is too large do not return the patch text by default + // TODO handle file patches that are too large + logger_1.logger.warn(`File ${file.filename} may have a patch that is too large to display patch object.`); + } + else { + const hunks = diff_utils_1.parsePatch(file.patch); + pullRequestHunks.set(file.filename, hunks); + } + }); + if (pullRequestHunks.size === 0) { + logger_1.logger.warn('0 patches have been returned. This could be because the patch results were too large to return.'); + } + return pullRequestHunks; } - +exports.getPullRequestHunks = getPullRequestHunks; +//# sourceMappingURL=review-pull-request.js.map /***/ }), -/***/ 70586: -/***/ (function(__unused_webpack_module, exports) { +/***/ 77103: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -var actionTypes = { - equals: "", - element: "~", - start: "^", - end: "$", - any: "*", - not: "!", - hyphen: "|", -}; -var charsToEscape = new Set(__spreadArray(__spreadArray([], Object.keys(actionTypes) - .map(function (typeKey) { return actionTypes[typeKey]; }) - .filter(Boolean), true), [ - ":", - "[", - "]", - " ", - "\\", - "(", - ")", - "'", -], false)); +exports.parseTextFiles = exports.createPullRequest = exports.reviewPullRequest = void 0; +const types_1 = __nccwpck_require__(13984); +const logger_1 = __nccwpck_require__(58192); +const default_options_handler_1 = __nccwpck_require__(9558); +const retry = __nccwpck_require__(33415); +const review_pull_request_1 = __nccwpck_require__(43102); +const branch_1 = __nccwpck_require__(58021); +const fork_1 = __nccwpck_require__(67386); +const commit_and_push_1 = __nccwpck_require__(4424); +const open_pull_request_1 = __nccwpck_require__(24461); +const labels_1 = __nccwpck_require__(8831); /** - * Turns `selector` back into a string. + * Given a set of suggestions, make all the multiline inline review comments on a given pull request given + * that they are in scope of the pull request. Outof scope suggestions are not made. * - * @param selector Selector to stringify. + * In-scope suggestions are specifically: the suggestion for a file must correspond to a file in the remote pull request + * and the diff hunk computed for a file's contents must produce a range that is a subset of the pull request's files hunks. + * + * If a file is too large to load in the review, it is skipped in the suggestion phase. + * + * If changes are empty then the workflow will not run. + * Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information. + * @param octokit The authenticated octokit instance, instantiated with an access token having permissiong to create a fork on the target repository. + * @param diffContents A set of changes. The changes may be empty. + * @param options The configuration for interacting with GitHub provided by the user. + * @returns the created review's id number, or null if there are no changes to be made. */ -function stringify(selector) { - return selector.map(stringifySubselector).join(", "); +async function reviewPullRequest(octokit, diffContents, options) { + logger_1.setupLogger(options.logger); + // if null undefined, or the empty map then no changes have been provided. + // Do not execute GitHub workflow + if (diffContents === null || + diffContents === undefined || + (typeof diffContents !== 'string' && diffContents.size === 0)) { + logger_1.logger.info('Empty changes provided. No suggestions to be made. Cancelling workflow.'); + return null; + } + const gitHubConfigs = default_options_handler_1.addReviewCommentsDefaults(options); + const remote = { + owner: gitHubConfigs.owner, + repo: gitHubConfigs.repo, + }; + const reviewNumber = await review_pull_request_1.createPullRequestReview(octokit, remote, gitHubConfigs.pullNumber, gitHubConfigs.pageSize, diffContents); + return reviewNumber; } -exports.default = stringify; -function stringifySubselector(token) { - return token.map(stringifyToken).join(""); +exports.reviewPullRequest = reviewPullRequest; +/** + * Make a new GitHub Pull Request with a set of changes applied on top of primary branch HEAD. + * The changes are committed into a new branch based on the upstream repository options using the authenticated Octokit account. + * Then a Pull Request is made from that branch. + * + * Also throws error if git data from the fork is not ready in 5 minutes. + * + * From the docs + * https://developer.github.com/v3/repos/forks/#create-a-fork + * """ + * Forking a Repository happens asynchronously. + * You may have to wait a short period of time before you can access the git objects. + * If this takes longer than 5 minutes, be sure to contact GitHub Support or GitHub Premium Support. + * """ + * + * If changes are empty then the workflow will not run. + * Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information. + * @param {Octokit} octokit The authenticated octokit instance, instantiated with an access token having permissiong to create a fork on the target repository + * @param {Changes | null | undefined} changes A set of changes. The changes may be empty + * @param {CreatePullRequestUserOptions} options The configuration for interacting with GitHub provided by the user. + * @returns {Promise} the pull request number. Returns 0 if unsuccessful. + */ +async function createPullRequest(octokit, changes, options) { + logger_1.setupLogger(options.logger); + // if null undefined, or the empty map then no changes have been provided. + // Do not execute GitHub workflow + if (changes === null || changes === undefined || changes.size === 0) { + logger_1.logger.info('Empty change set provided. No changes need to be made. Cancelling workflow.'); + return 0; + } + const gitHubConfigs = default_options_handler_1.addPullRequestDefaults(options); + logger_1.logger.info('Starting GitHub PR workflow...'); + const upstream = { + owner: gitHubConfigs.upstreamOwner, + repo: gitHubConfigs.upstreamRepo, + }; + const origin = options.fork === false ? upstream : await fork_1.fork(octokit, upstream); + const originBranch = { + ...origin, + branch: gitHubConfigs.branch, + }; + // The `retry` flag defaults to `5` to maintain compatibility + options.retry = options.retry === undefined ? 5 : options.retry; + const refHeadSha = await retry(async () => await branch_1.branch(octokit, origin, upstream, originBranch.branch, gitHubConfigs.primary), { + retries: options.retry, + factor: 2.8411, + minTimeout: 3000, + randomize: false, + onRetry: (e, attempt) => { + e.message = `Error creating Pull Request: ${e.message}`; + logger_1.logger.error(e); + logger_1.logger.info(`Retry attempt #${attempt}...`); + }, + }); + await commit_and_push_1.commitAndPush(octokit, refHeadSha, changes, originBranch, gitHubConfigs.message, gitHubConfigs.force); + const description = { + body: gitHubConfigs.description, + title: gitHubConfigs.title, + }; + const prNumber = await open_pull_request_1.openPullRequest(octokit, upstream, originBranch, description, gitHubConfigs.maintainersCanModify, gitHubConfigs.primary, options.draft); + logger_1.logger.info(`Successfully opened pull request: ${prNumber}.`); + // addLabels will no-op if options.labels is undefined or empty. + await labels_1.addLabels(octokit, upstream, originBranch, prNumber, options.labels); + return prNumber; } -function stringifyToken(token) { - switch (token.type) { - // Simple types - case "child": - return " > "; - case "parent": - return " < "; - case "sibling": - return " ~ "; - case "adjacent": - return " + "; - case "descendant": - return " "; - case "universal": - return getNamespace(token.namespace) + "*"; - case "tag": - return getNamespacedName(token); - case "pseudo-element": - return "::" + escapeName(token.name); - case "pseudo": - if (token.data === null) - return ":" + escapeName(token.name); - if (typeof token.data === "string") { - return ":" + escapeName(token.name) + "(" + escapeName(token.data) + ")"; - } - return ":" + escapeName(token.name) + "(" + stringify(token.data) + ")"; - case "attribute": { - if (token.name === "id" && - token.action === "equals" && - !token.ignoreCase && - !token.namespace) { - return "#" + escapeName(token.value); - } - if (token.name === "class" && - token.action === "element" && - !token.ignoreCase && - !token.namespace) { - return "." + escapeName(token.value); +exports.createPullRequest = createPullRequest; +/** + * Convert a Map or {[path: string]: string}, where the key is the relative file path in the repository, + * and the value is the text content. The files will be converted to a Map also containing the file mode information '100644' + * @param {Object | Map} textFiles a map/object where the key is the relative file path and the value is the text file content + * @returns {Changes} Map of the file path to the string file content and the file mode '100644' + */ +function parseTextFiles(textFiles) { + const changes = new Map(); + if (textFiles instanceof Map) { + textFiles.forEach((content, path) => { + if (typeof path !== 'string' || + (content !== null && typeof content !== 'string')) { + throw TypeError('The file changeset provided must have a string key and a string/null value'); } - var name_1 = getNamespacedName(token); - if (token.action === "exists") { - return "[" + name_1 + "]"; + changes.set(path, new types_1.FileData(content)); + }); + } + else { + for (const [path, content] of Object.entries(textFiles)) { + if (typeof path !== 'string' || + (content !== null && typeof content !== 'string')) { + throw TypeError('The file changeset provided must have a string key and a string/null value'); } - return "[" + name_1 + actionTypes[token.action] + "='" + escapeName(token.value) + "'" + (token.ignoreCase ? "i" : token.ignoreCase === false ? "s" : "") + "]"; + changes.set(path, new types_1.FileData(content)); } } + return changes; } -function getNamespacedName(token) { - return "" + getNamespace(token.namespace) + escapeName(token.name); -} -function getNamespace(namespace) { - return namespace !== null - ? (namespace === "*" ? "*" : escapeName(namespace)) + "|" - : ""; -} -function escapeName(str) { - return str - .split("") - .map(function (c) { return (charsToEscape.has(c) ? "\\" + c : c); }) - .join(""); -} - +exports.parseTextFiles = parseTextFiles; +//# sourceMappingURL=index.js.map /***/ }), -/***/ 51512: -/***/ (function(module) { - -/* - * Date Format 1.2.3 - * (c) 2007-2009 Steven Levithan - * MIT license - * - * Includes enhancements by Scott Trenda - * and Kris Kowal - * - * Accepts a date, a mask, or a date and a mask. - * Returns a formatted version of the given date. - * The date defaults to the current date/time. - * The mask defaults to dateFormat.masks.default. - */ +/***/ 58192: +/***/ ((__unused_webpack_module, exports) => { -(function(global) { - 'use strict'; +"use strict"; - var dateFormat = (function() { - var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|"[^"]*"|'[^']*'/g; - var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g; - var timezoneClip = /[^-+\dA-Z]/g; - - // Regexes and supporting functions are cached through closure - return function (date, mask, utc, gmt) { - - // You can't provide utc if you skip other args (use the 'UTC:' mask prefix) - if (arguments.length === 1 && kindOf(date) === 'string' && !/\d/.test(date)) { - mask = date; - date = undefined; - } - - date = date || new Date; - - if(!(date instanceof Date)) { - date = new Date(date); - } - - if (isNaN(date)) { - throw TypeError('Invalid date'); - } - - mask = String(dateFormat.masks[mask] || mask || dateFormat.masks['default']); - - // Allow setting the utc/gmt argument via the mask - var maskSlice = mask.slice(0, 4); - if (maskSlice === 'UTC:' || maskSlice === 'GMT:') { - mask = mask.slice(4); - utc = true; - if (maskSlice === 'GMT:') { - gmt = true; - } - } - - var _ = utc ? 'getUTC' : 'get'; - var d = date[_ + 'Date'](); - var D = date[_ + 'Day'](); - var m = date[_ + 'Month'](); - var y = date[_ + 'FullYear'](); - var H = date[_ + 'Hours'](); - var M = date[_ + 'Minutes'](); - var s = date[_ + 'Seconds'](); - var L = date[_ + 'Milliseconds'](); - var o = utc ? 0 : date.getTimezoneOffset(); - var W = getWeek(date); - var N = getDayOfWeek(date); - var flags = { - d: d, - dd: pad(d), - ddd: dateFormat.i18n.dayNames[D], - dddd: dateFormat.i18n.dayNames[D + 7], - m: m + 1, - mm: pad(m + 1), - mmm: dateFormat.i18n.monthNames[m], - mmmm: dateFormat.i18n.monthNames[m + 12], - yy: String(y).slice(2), - yyyy: y, - h: H % 12 || 12, - hh: pad(H % 12 || 12), - H: H, - HH: pad(H), - M: M, - MM: pad(M), - s: s, - ss: pad(s), - l: pad(L, 3), - L: pad(Math.round(L / 10)), - t: H < 12 ? dateFormat.i18n.timeNames[0] : dateFormat.i18n.timeNames[1], - tt: H < 12 ? dateFormat.i18n.timeNames[2] : dateFormat.i18n.timeNames[3], - T: H < 12 ? dateFormat.i18n.timeNames[4] : dateFormat.i18n.timeNames[5], - TT: H < 12 ? dateFormat.i18n.timeNames[6] : dateFormat.i18n.timeNames[7], - Z: gmt ? 'GMT' : utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''), - o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), - S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10], - W: W, - N: N - }; - - return mask.replace(token, function (match) { - if (match in flags) { - return flags[match]; - } - return match.slice(1, match.length - 1); - }); - }; - })(); +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.setupLogger = exports.logger = void 0; +let logger; +exports.logger = logger; +class NullLogger { + constructor() { + this.error = () => { }; + this.warn = () => { }; + this.info = () => { }; + this.debug = () => { }; + this.trace = () => { }; + } +} +function setupLogger(userLogger) { + if (userLogger) { + exports.logger = logger = userLogger; + } + else { + exports.logger = logger = new NullLogger(); + } +} +exports.setupLogger = setupLogger; +//# sourceMappingURL=logger.js.map - dateFormat.masks = { - 'default': 'ddd mmm dd yyyy HH:MM:ss', - 'shortDate': 'm/d/yy', - 'mediumDate': 'mmm d, yyyy', - 'longDate': 'mmmm d, yyyy', - 'fullDate': 'dddd, mmmm d, yyyy', - 'shortTime': 'h:MM TT', - 'mediumTime': 'h:MM:ss TT', - 'longTime': 'h:MM:ss TT Z', - 'isoDate': 'yyyy-mm-dd', - 'isoTime': 'HH:MM:ss', - 'isoDateTime': 'yyyy-mm-dd\'T\'HH:MM:sso', - 'isoUtcDateTime': 'UTC:yyyy-mm-dd\'T\'HH:MM:ss\'Z\'', - 'expiresHeaderFormat': 'ddd, dd mmm yyyy HH:MM:ss Z' - }; +/***/ }), - // Internationalization strings - dateFormat.i18n = { - dayNames: [ - 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', - 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' - ], - monthNames: [ - 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', - 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' - ], - timeNames: [ - 'a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM' - ] - }; +/***/ 13984: +/***/ ((__unused_webpack_module, exports) => { -function pad(val, len) { - val = String(val); - len = len || 2; - while (val.length < len) { - val = '0' + val; - } - return val; -} +"use strict"; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PatchSyntaxError = exports.FileData = void 0; /** - * Get the ISO 8601 week number - * Based on comments from - * http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html - * - * @param {Object} `date` - * @return {Number} + * The content and the mode of a file. + * Default file mode is a text file which has code '100644'. + * If `content` is not null, then `content` must be the entire file content. + * See https://developer.github.com/v3/git/trees/#tree-object for details on mode. */ -function getWeek(date) { - // Remove time components of date - var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate()); - - // Change date to Thursday same week - targetThursday.setDate(targetThursday.getDate() - ((targetThursday.getDay() + 6) % 7) + 3); - - // Take January 4th as it is always in week 1 (see ISO 8601) - var firstThursday = new Date(targetThursday.getFullYear(), 0, 4); +class FileData { + constructor(content, mode = '100644') { + this.mode = mode; + this.content = content; + } +} +exports.FileData = FileData; +class PatchSyntaxError extends Error { + constructor(message) { + super(message); + this.name = 'PatchSyntaxError'; + } +} +exports.PatchSyntaxError = PatchSyntaxError; +//# sourceMappingURL=types.js.map - // Change date to Thursday same week - firstThursday.setDate(firstThursday.getDate() - ((firstThursday.getDay() + 6) % 7) + 3); +/***/ }), - // Check if daylight-saving-time-switch occurred and correct for it - var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset(); - targetThursday.setHours(targetThursday.getHours() - ds); +/***/ 15276: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - // Number of weeks between target Thursday and first Thursday - var weekDiff = (targetThursday - firstThursday) / (86400000*7); - return 1 + Math.floor(weekDiff); -} +"use strict"; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getSuggestedHunks = exports.parseAllHunks = exports.parsePatch = void 0; +const parseDiff = __nccwpck_require__(94833); +const diff_1 = __nccwpck_require__(71672); +// This header is ignored for calculating patch ranges, but is neccessary +// for parsing a diff +const _DIFF_HEADER = `diff --git a/file.ext b/file.ext +index cac8fbc..87f387c 100644 +--- a/file.ext ++++ b/file.ext +`; /** - * Get ISO-8601 numeric representation of the day of the week - * 1 (for Monday) through 7 (for Sunday) - * - * @param {Object} `date` - * @return {Number} + * Given a patch expressed in GNU diff format, return the range of lines + * from the original content that are changed. + * @param diff Diff expressed in GNU diff format. + * @returns Hunk[] */ -function getDayOfWeek(date) { - var dow = date.getDay(); - if(dow === 0) { - dow = 7; - } - return dow; +function parsePatch(patch) { + return parseAllHunks(_DIFF_HEADER + patch).get('file.ext') || []; } - +exports.parsePatch = parsePatch; /** - * kind-of shortcut - * @param {*} val - * @return {String} + * Given a diff expressed in GNU diff format, return the range of lines + * from the original content that are changed. + * @param diff Diff expressed in GNU diff format. + * @returns Map */ -function kindOf(val) { - if (val === null) { - return 'null'; - } - - if (val === undefined) { - return 'undefined'; - } - - if (typeof val !== 'object') { - return typeof val; - } - - if (Array.isArray(val)) { - return 'array'; - } - - return {}.toString.call(val) - .slice(8, -1).toLowerCase(); -}; - - - - if (typeof define === 'function' && define.amd) { - define(function () { - return dateFormat; +function parseAllHunks(diff) { + const hunksByFile = new Map(); + parseDiff(diff).forEach(file => { + const filename = file.to ? file.to : file.from; + const chunks = file.chunks.map(chunk => { + let oldStart = chunk.oldStart; + let newStart = chunk.newStart; + let normalLines = 0; + let changeSeen = false; + const newLines = []; + let previousLine = null; + let nextLine = null; + chunk.changes.forEach(change => { + // strip off leading '+', '-', or ' ' and trailing carriage return + const content = change.content.substring(1).replace(/[\n\r]+$/g, ''); + if (change.type === 'normal') { + normalLines++; + if (changeSeen) { + if (nextLine === null) { + nextLine = content; + } + } + else { + previousLine = content; + } + } + else { + if (change.type === 'add') { + // strip off leading '+' and trailing carriage return + newLines.push(content); + } + if (!changeSeen) { + oldStart += normalLines; + newStart += normalLines; + changeSeen = true; + } + } + }); + const newEnd = newStart + chunk.newLines - normalLines - 1; + const oldEnd = oldStart + chunk.oldLines - normalLines - 1; + let hunk = { + oldStart: oldStart, + oldEnd: oldEnd, + newStart: newStart, + newEnd: newEnd, + newContent: newLines, + }; + if (previousLine) { + hunk = { ...hunk, previousLine: previousLine }; + } + if (nextLine) { + hunk = { ...hunk, nextLine: nextLine }; + } + return hunk; + }); + hunksByFile.set(filename, chunks); }); - } else if (true) { - module.exports = dateFormat; - } else {} -})(this); - + return hunksByFile; +} +exports.parseAllHunks = parseAllHunks; +/** + * Given two texts, return the range of lines that are changed. + * @param oldContent The original content. + * @param newContent The new content. + * @returns Hunk[] + */ +function getSuggestedHunks(oldContent, newContent) { + const diff = diff_1.createPatch('unused', oldContent, newContent); + return parseAllHunks(diff).get('unused') || []; +} +exports.getSuggestedHunks = getSuggestedHunks; +//# sourceMappingURL=diff-utils.js.map /***/ }), -/***/ 61318: -/***/ ((module) => { +/***/ 26381: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +"use strict"; +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.partitionSuggestedHunksByScope = exports.getRawSuggestionHunks = exports.adjustHunkDown = exports.adjustHunkUp = void 0; +const diff_utils_1 = __nccwpck_require__(15276); +const logger_1 = __nccwpck_require__(58192); /** - * Expose `Delegator`. + * Shift a Hunk up one line so it starts one line earlier. + * @param {Hunk} hunk + * @returns {Hunk | null} the adjusted Hunk or null if there is no preceeding line. */ - -module.exports = Delegator; - +function adjustHunkUp(hunk) { + if (!hunk.previousLine) { + return null; + } + return { + oldStart: hunk.oldStart - 1, + oldEnd: hunk.oldEnd, + newStart: hunk.newStart - 1, + newEnd: hunk.newEnd, + newContent: [hunk.previousLine, ...hunk.newContent], + }; +} +exports.adjustHunkUp = adjustHunkUp; /** - * Initialize a delegator. - * - * @param {Object} proto - * @param {String} target - * @api public + * Shift a Hunk up one line so it ends one line later. + * @param {Hunk} hunk + * @returns {Hunk | null} the adjusted Hunk or null if there is no following line. */ - -function Delegator(proto, target) { - if (!(this instanceof Delegator)) return new Delegator(proto, target); - this.proto = proto; - this.target = target; - this.methods = []; - this.getters = []; - this.setters = []; - this.fluents = []; +function adjustHunkDown(hunk) { + if (!hunk.nextLine) { + return null; + } + return { + oldStart: hunk.oldStart, + oldEnd: hunk.oldEnd + 1, + newStart: hunk.newStart, + newEnd: hunk.newEnd + 1, + newContent: hunk.newContent.concat(hunk.nextLine), + }; } - +exports.adjustHunkDown = adjustHunkDown; /** - * Delegate method `name`. - * - * @param {String} name - * @return {Delegator} self - * @api public + * Given a map where the key is the file name and the value is the + * old content and new content of the file + * compute the hunk for each file whose old and new contents differ. + * Do not compute the hunk if the old content is the same as the new content. + * The hunk list is sorted and each interval is disjoint. + * @param {Map} diffContents a map of the original file contents and the new file contents + * @returns the hunks for each file whose old and new contents differ + */ +function getRawSuggestionHunks(diffContents) { + const fileHunks = new Map(); + diffContents.forEach((fileDiffContent, fileName) => { + // if identical don't calculate the hunk and continue in the loop + if (fileDiffContent.oldContent === fileDiffContent.newContent) { + return; + } + const hunks = diff_utils_1.getSuggestedHunks(fileDiffContent.oldContent, fileDiffContent.newContent); + fileHunks.set(fileName, hunks); + }); + logger_1.logger.info('Parsed ranges of old and new patch'); + return fileHunks; +} +exports.getRawSuggestionHunks = getRawSuggestionHunks; +function hunkOverlaps(validHunk, suggestedHunk) { + return (suggestedHunk.oldStart >= validHunk.newStart && + suggestedHunk.oldEnd <= validHunk.newEnd); +} +function partitionFileHunks(pullRequestHunks, suggestedHunks) { + // check ranges: the entirety of the old range of the suggested + // hunk must fit inside the new range of the valid Hunks + let i = 0; + let candidateHunk = pullRequestHunks[i]; + const validFileHunks = []; + const invalidFileHunks = []; + suggestedHunks.forEach(suggestedHunk => { + while (candidateHunk && suggestedHunk.oldStart > candidateHunk.newEnd) { + i++; + candidateHunk = pullRequestHunks[i]; + } + if (!candidateHunk) { + invalidFileHunks.push(suggestedHunk); + return; + } + // if deletion only or addition only + if (suggestedHunk.newEnd < suggestedHunk.newStart || + suggestedHunk.oldEnd < suggestedHunk.oldStart) { + // try using previous line + let adjustedHunk = adjustHunkUp(suggestedHunk); + if (adjustedHunk && hunkOverlaps(candidateHunk, adjustedHunk)) { + validFileHunks.push(adjustedHunk); + return; + } + // try using next line + adjustedHunk = adjustHunkDown(suggestedHunk); + if (adjustedHunk && hunkOverlaps(candidateHunk, adjustedHunk)) { + validFileHunks.push(adjustedHunk); + return; + } + } + else if (hunkOverlaps(candidateHunk, suggestedHunk)) { + validFileHunks.push(suggestedHunk); + return; + } + invalidFileHunks.push(suggestedHunk); + }); + return { validFileHunks, invalidFileHunks }; +} +/** + * Split suggested hunks into commentable and non-commentable hunks. Compares the new line ranges + * from pullRequestHunks against the old line ranges from allSuggestedHunks. + * @param pullRequestHunks {Map} The parsed hunks from that represents the valid lines to comment. + * @param allSuggestedHunks {Map} The hunks that represent suggested changes. + * @returns {PartitionedHunks} split hunks */ +function partitionSuggestedHunksByScope(pullRequestHunks, allSuggestedHunks) { + const validHunks = new Map(); + const invalidHunks = new Map(); + allSuggestedHunks.forEach((suggestedHunks, filename) => { + const pullRequestFileHunks = pullRequestHunks.get(filename); + if (!pullRequestFileHunks) { + // file is not the original PR + invalidHunks.set(filename, suggestedHunks); + return; + } + const { validFileHunks, invalidFileHunks } = partitionFileHunks(pullRequestFileHunks, suggestedHunks); + if (validFileHunks.length > 0) { + validHunks.set(filename, validFileHunks); + } + if (invalidFileHunks.length > 0) { + invalidHunks.set(filename, invalidFileHunks); + } + }); + return { validHunks, invalidHunks }; +} +exports.partitionSuggestedHunksByScope = partitionSuggestedHunksByScope; +//# sourceMappingURL=hunk-utils.js.map -Delegator.prototype.method = function(name){ - var proto = this.proto; - var target = this.target; - this.methods.push(name); +/***/ }), - proto[name] = function(){ - return this[target][name].apply(this[target], arguments); - }; +/***/ 97391: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - return this; -}; +/* MIT license */ +/* eslint-disable no-mixed-operators */ +const cssKeywords = __nccwpck_require__(78510); -/** - * Delegator accessor `name`. - * - * @param {String} name - * @return {Delegator} self - * @api public - */ +// NOTE: conversions should only return primitive values (i.e. arrays, or +// values that give correct `typeof` results). +// do not use box values types (i.e. Number(), String(), etc.) -Delegator.prototype.access = function(name){ - return this.getter(name).setter(name); +const reverseKeywords = {}; +for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; +} + +const convert = { + rgb: {channels: 3, labels: 'rgb'}, + hsl: {channels: 3, labels: 'hsl'}, + hsv: {channels: 3, labels: 'hsv'}, + hwb: {channels: 3, labels: 'hwb'}, + cmyk: {channels: 4, labels: 'cmyk'}, + xyz: {channels: 3, labels: 'xyz'}, + lab: {channels: 3, labels: 'lab'}, + lch: {channels: 3, labels: 'lch'}, + hex: {channels: 1, labels: ['hex']}, + keyword: {channels: 1, labels: ['keyword']}, + ansi16: {channels: 1, labels: ['ansi16']}, + ansi256: {channels: 1, labels: ['ansi256']}, + hcg: {channels: 3, labels: ['h', 'c', 'g']}, + apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, + gray: {channels: 1, labels: ['gray']} }; -/** - * Delegator getter `name`. - * - * @param {String} name - * @return {Delegator} self - * @api public - */ +module.exports = convert; -Delegator.prototype.getter = function(name){ - var proto = this.proto; - var target = this.target; - this.getters.push(name); +// Hide .channels and .labels properties +for (const model of Object.keys(convert)) { + if (!('channels' in convert[model])) { + throw new Error('missing channels property: ' + model); + } - proto.__defineGetter__(name, function(){ - return this[target][name]; - }); + if (!('labels' in convert[model])) { + throw new Error('missing channel labels property: ' + model); + } - return this; -}; + if (convert[model].labels.length !== convert[model].channels) { + throw new Error('channel and label counts mismatch: ' + model); + } -/** - * Delegator setter `name`. - * - * @param {String} name - * @return {Delegator} self - * @api public - */ + const {channels, labels} = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], 'channels', {value: channels}); + Object.defineProperty(convert[model], 'labels', {value: labels}); +} -Delegator.prototype.setter = function(name){ - var proto = this.proto; - var target = this.target; - this.setters.push(name); +convert.rgb.hsl = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; - proto.__defineSetter__(name, function(val){ - return this[target][name] = val; - }); + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } - return this; -}; + h = Math.min(h * 60, 360); -/** - * Delegator fluent accessor - * - * @param {String} name - * @return {Delegator} self - * @api public - */ + if (h < 0) { + h += 360; + } -Delegator.prototype.fluent = function (name) { - var proto = this.proto; - var target = this.target; - this.fluents.push(name); + const l = (min + max) / 2; - proto[name] = function(val){ - if ('undefined' != typeof val) { - this[target][name] = val; - return this; - } else { - return this[target][name]; - } - }; + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } - return this; + return [h, s * 100, l * 100]; }; +convert.rgb.hsv = function (rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s; -/***/ }), + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; -/***/ 58932: -/***/ ((__unused_webpack_module, exports) => { + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); -"use strict"; + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = (1 / 3) + rdif - bdif; + } else if (b === v) { + h = (2 / 3) + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); + return [ + h * 360, + s * 100, + v * 100 + ]; +}; -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) +convert.rgb.hwb = function (rgb) { + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r, Math.min(g, b)); - /* istanbul ignore next */ + b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } + return [h, w * 100, b * 100]; +}; - this.name = 'Deprecation'; - } +convert.rgb.cmyk = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; -} + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; -exports.Deprecation = Deprecation; + return [c * 100, m * 100, y * 100, k * 100]; +}; +function comparativeDistance(x, y) { + /* + See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance + */ + return ( + ((x[0] - y[0]) ** 2) + + ((x[1] - y[1]) ** 2) + + ((x[2] - y[2]) ** 2) + ); +} -/***/ }), +convert.rgb.keyword = function (rgb) { + const reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } -/***/ 83084: -/***/ ((module) => { + let currentClosestDistance = Infinity; + let currentClosestKeyword; -"use strict"; + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; + // Compute comparative distance + const distance = comparativeDistance(rgb, value); -// Detect either spaces or tabs but not both to properly handle tabs for indentation and spaces for alignment -const INDENT_REGEX = /^(?:( )+|\t+)/; + // Check if its less, if so set as closest + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } -const INDENT_TYPE_SPACE = 'space'; -const INDENT_TYPE_TAB = 'tab'; + return currentClosestKeyword; +}; -// Make a Map that counts how many indents/unindents have occurred for a given size and how many lines follow a given indentation. -// The key is a concatenation of the indentation type (s = space and t = tab) and the size of the indents/unindents. -// -// indents = { -// t3: [1, 0], -// t4: [1, 5], -// s5: [1, 0], -// s12: [1, 0], -// } -function makeIndentsMap(string, ignoreSingleSpaces) { - const indents = new Map(); +convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; +}; - // Remember the size of previous line's indentation - let previousSize = 0; - let previousIndentType; +convert.rgb.xyz = function (rgb) { + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; - // Indents key (ident type + size of the indents/unindents) - let key; + // Assume sRGB + r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); + g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); + b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); - for (const line of string.split(/\n/g)) { - if (!line) { - // Ignore empty lines - continue; - } + const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); + const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); + const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); - let indent; - let indentType; - let weight; - let entry; - const matches = line.match(INDENT_REGEX); + return [x * 100, y * 100, z * 100]; +}; - if (matches === null) { - previousSize = 0; - previousIndentType = ''; - } else { - indent = matches[0].length; +convert.rgb.lab = function (rgb) { + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; - if (matches[1]) { - indentType = INDENT_TYPE_SPACE; - } else { - indentType = INDENT_TYPE_TAB; - } + x /= 95.047; + y /= 100; + z /= 108.883; - // Ignore single space unless it's the only indent detected to prevent common false positives - if (ignoreSingleSpaces && indentType === INDENT_TYPE_SPACE && indent === 1) { - continue; - } + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - if (indentType !== previousIndentType) { - previousSize = 0; - } + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); - previousIndentType = indentType; + return [l, a, b]; +}; - weight = 0; +convert.hsl.rgb = function (hsl) { + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; - const indentDifference = indent - previousSize; - previousSize = indent; + if (s === 0) { + val = l * 255; + return [val, val, val]; + } - // Previous line have same indent? - if (indentDifference === 0) { - weight++; - // We use the key from previous loop - } else { - const absoluteIndentDifference = indentDifference > 0 ? indentDifference : -indentDifference; - key = encodeIndentsKey(indentType, absoluteIndentDifference); - } + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } - // Update the stats - entry = indents.get(key); + const t1 = 2 * l - t2; - if (entry === undefined) { - entry = [1, 0]; // Init - } else { - entry = [++entry[0], entry[1] + weight]; - } + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { + t3 = h + 1 / 3 * -(i - 1); + if (t3 < 0) { + t3++; + } - indents.set(key, entry); + if (t3 > 1) { + t3--; + } + + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; } + + rgb[i] = val * 255; } - return indents; -} + return rgb; +}; -// Encode the indent type and amount as a string (e.g. 's4') for use as a compound key in the indents Map. -function encodeIndentsKey(indentType, indentAmount) { - const typeCharacter = indentType === INDENT_TYPE_SPACE ? 's' : 't'; - return typeCharacter + String(indentAmount); -} +convert.hsl.hsv = function (hsl) { + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); -// Extract the indent type and amount from a key of the indents Map. -function decodeIndentsKey(indentsKey) { - const keyHasTypeSpace = indentsKey[0] === 's'; - const type = keyHasTypeSpace ? INDENT_TYPE_SPACE : INDENT_TYPE_TAB; + l *= 2; + s *= (l <= 1) ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); - const amount = Number(indentsKey.slice(1)); + return [h, sv * 100, v * 100]; +}; - return {type, amount}; -} +convert.hsv.rgb = function (hsv) { + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; -// Return the key (e.g. 's4') from the indents Map that represents the most common indent, -// or return undefined if there are no indents. -function getMostUsedKey(indents) { - let result; - let maxUsed = 0; - let maxWeight = 0; + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - (s * f)); + const t = 255 * v * (1 - (s * (1 - f))); + v *= 255; - for (const [key, [usedCount, weight]] of indents) { - if (usedCount > maxUsed || (usedCount === maxUsed && weight > maxWeight)) { - maxUsed = usedCount; - maxWeight = weight; - result = key; - } + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; } +}; - return result; -} +convert.hsv.hsl = function (hsv) { + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; -function makeIndentString(type, amount) { - const indentCharacter = type === INDENT_TYPE_SPACE ? ' ' : '\t'; - return indentCharacter.repeat(amount); -} + l = (2 - s) * v; + const lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= (lmin <= 1) ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; -module.exports = string => { - if (typeof string !== 'string') { - throw new TypeError('Expected a string'); - } + return [h, sl * 100, l * 100]; +}; - // Identify indents while skipping single space indents to avoid common edge cases (e.g. code comments) - // If no indents are identified, run again and include all indents for comprehensive detection - let indents = makeIndentsMap(string, true); - if (indents.size === 0) { - indents = makeIndentsMap(string, false); +// http://dev.w3.org/csswg/css-color/#hwb-to-rgb +convert.hwb.rgb = function (hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; + + // Wh + bl cant be > 1 + if (ratio > 1) { + wh /= ratio; + bl /= ratio; } - const keyOfMostUsedIndent = getMostUsedKey(indents); + const i = Math.floor(6 * h); + const v = 1 - bl; + f = 6 * h - i; - let type; - let amount = 0; - let indent = ''; + if ((i & 0x01) !== 0) { + f = 1 - f; + } - if (keyOfMostUsedIndent !== undefined) { - ({type, amount} = decodeIndentsKey(keyOfMostUsedIndent)); - indent = makeIndentString(type, amount); + const n = wh + f * (v - wh); // Linear interpolation + + let r; + let g; + let b; + /* eslint-disable max-statements-per-line,no-multi-spaces */ + switch (i) { + default: + case 6: + case 0: r = v; g = n; b = wh; break; + case 1: r = n; g = v; b = wh; break; + case 2: r = wh; g = v; b = n; break; + case 3: r = wh; g = n; b = v; break; + case 4: r = n; g = wh; b = v; break; + case 5: r = v; g = wh; b = n; break; } + /* eslint-enable max-statements-per-line,no-multi-spaces */ - return { - amount, - type, - indent - }; + return [r * 255, g * 255, b * 255]; }; +convert.cmyk.rgb = function (cmyk) { + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; -/***/ }), - -/***/ 32859: -/***/ ((__unused_webpack_module, exports) => { + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); -"use strict"; -/*istanbul ignore start*/ + return [r * 255, g * 255, b * 255]; +}; +convert.xyz.rgb = function (xyz) { + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.convertChangesToDMP = convertChangesToDMP; + r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); + g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); + b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); -/*istanbul ignore end*/ -// See: http://code.google.com/p/google-diff-match-patch/wiki/API -function convertChangesToDMP(changes) { - var ret = [], - change, - operation; + // Assume sRGB + r = r > 0.0031308 + ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) + : r * 12.92; - for (var i = 0; i < changes.length; i++) { - change = changes[i]; + g = g > 0.0031308 + ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) + : g * 12.92; - if (change.added) { - operation = 1; - } else if (change.removed) { - operation = -1; - } else { - operation = 0; - } + b = b > 0.0031308 + ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) + : b * 12.92; - ret.push([operation, change.value]); - } + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); - return ret; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ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XNUb0RNUChjaGFuZ2VzKSB7XG4gIGxldCByZXQgPSBbXSxcbiAgICAgIGNoYW5nZSxcbiAgICAgIG9wZXJhdGlvbjtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFuZ2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgY2hhbmdlID0gY2hhbmdlc1tpXTtcbiAgICBpZiAoY2hhbmdlLmFkZGVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAxO1xuICAgIH0gZWxzZSBpZiAoY2hhbmdlLnJlbW92ZWQpIHtcbiAgICAgIG9wZXJhdGlvbiA9IC0xO1xuICAgIH0gZWxzZSB7XG4gICAgICBvcGVyYXRpb24gPSAwO1xuICAgIH1cblxuICAgIHJldC5wdXNoKFtvcGVyYXRpb24sIGNoYW5nZS52YWx1ZV0pO1xuICB9XG4gIHJldHVybiByZXQ7XG59XG4iXX0= + return [r * 255, g * 255, b * 255]; +}; +convert.xyz.lab = function (xyz) { + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; -/***/ }), + x /= 95.047; + y /= 100; + z /= 108.883; -/***/ 16982: -/***/ ((__unused_webpack_module, exports) => { + x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); + y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); + z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); -"use strict"; -/*istanbul ignore start*/ + const l = (116 * y) - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + return [l, a, b]; +}; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.convertChangesToXML = convertChangesToXML; +convert.lab.xyz = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; -/*istanbul ignore end*/ -function convertChangesToXML(changes) { - var ret = []; + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; + y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } + x *= 95.047; + y *= 100; + z *= 108.883; - ret.push(escapeHTML(change.value)); + return [x, y, z]; +}; - if (change.added) { - ret.push(''); - } else if (change.removed) { - ret.push(''); - } - } +convert.lab.lch = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; - return ret.join(''); -} + const hr = Math.atan2(b, a); + h = hr * 360 / 2 / Math.PI; -function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, '&'); - n = n.replace(//g, '>'); - n = n.replace(/"/g, '"'); - return n; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvWE1MIiwiY2hhbmdlcyIsInJldCIsImkiLCJsZW5ndGgiLCJjaGFuZ2UiLCJhZGRlZCIsInB1c2giLCJyZW1vdmVkIiwiZXNjYXBlSFRNTCIsInZhbHVlIiwiam9pbiIsInMiLCJuIiwicmVwbGFjZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQU8sU0FBU0EsbUJBQVQsQ0FBNkJDLE9BQTdCLEVBQXNDO0FBQzNDLE1BQUlDLEdBQUcsR0FBRyxFQUFWOztBQUNBLE9BQUssSUFBSUMsQ0FBQyxHQUFHLENBQWIsRUFBZ0JBLENBQUMsR0FBR0YsT0FBTyxDQUFDRyxNQUE1QixFQUFvQ0QsQ0FBQyxFQUFyQyxFQUF5QztBQUN2QyxRQUFJRSxNQUFNLEdBQUdKLE9BQU8sQ0FBQ0UsQ0FBRCxDQUFwQjs7QUFDQSxRQUFJRSxNQUFNLENBQUN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2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gY29udmVydENoYW5nZXNUb1hNTChjaGFuZ2VzKSB7XG4gIGxldCByZXQgPSBbXTtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFuZ2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgcmV0LnB1c2goJzxpbnM+Jyk7XG4gICAgfSBlbHNlIGlmIChjaGFuZ2UucmVtb3ZlZCkge1xuICAgICAgcmV0LnB1c2goJzxkZWw+Jyk7XG4gICAgfVxuXG4gICAgcmV0LnB1c2goZXNjYXBlSFRNTChjaGFuZ2UudmFsdWUpKTtcblxuICAgIGlmIChjaGFuZ2UuYWRkZWQpIHtcbiAgICAgIHJldC5wdXNoKCc8L2lucz4nKTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICByZXQucHVzaCgnPC9kZWw+Jyk7XG4gICAgfVxuICB9XG4gIHJldHVybiByZXQuam9pbignJyk7XG59XG5cbmZ1bmN0aW9uIGVzY2FwZUhUTUwocykge1xuICBsZXQgbiA9IHM7XG4gIG4gPSBuLnJlcGxhY2UoLyYvZywgJyZhbXA7Jyk7XG4gIG4gPSBuLnJlcGxhY2UoLzwvZywgJyZsdDsnKTtcbiAgbiA9IG4ucmVwbGFjZSgvPi9nLCAnJmd0OycpO1xuICBuID0gbi5yZXBsYWNlKC9cIi9nLCAnJnF1b3Q7Jyk7XG5cbiAgcmV0dXJuIG47XG59XG4iXX0= + if (h < 0) { + h += 360; + } + const c = Math.sqrt(a * a + b * b); -/***/ }), + return [l, c, h]; +}; -/***/ 70546: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +convert.lch.lab = function (lch) { + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; -"use strict"; -/*istanbul ignore start*/ + const hr = h / 360 * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); + return [l, a, b]; +}; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.diffArrays = diffArrays; -exports.arrayDiff = void 0; +convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(__nccwpck_require__(21653)) -/*istanbul ignore end*/ -; + value = Math.round(value / 50); -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + if (value === 0) { + return 30; + } -/*istanbul ignore end*/ -var arrayDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -[ -/*istanbul ignore start*/ -"default" -/*istanbul ignore end*/ -](); + let ansi = 30 + + ((Math.round(b / 255) << 2) + | (Math.round(g / 255) << 1) + | Math.round(r / 255)); -/*istanbul ignore start*/ -exports.arrayDiff = arrayDiff; + if (value === 2) { + ansi += 60; + } -/*istanbul ignore end*/ -arrayDiff.tokenize = function (value) { - return value.slice(); + return ansi; }; -arrayDiff.join = arrayDiff.removeEmpty = function (value) { - return value; +convert.hsv.ansi16 = function (args) { + // Optimization here; we already know the value and don't need to get + // it converted for us. + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; -function diffArrays(oldArr, newArr, callback) { - return arrayDiff.diff(oldArr, newArr, callback); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2FycmF5LmpzIl0sIm5hbWVzIjpbImFycmF5RGlmZiIsIkRpZmYiLCJ0b2tlbml6ZSIsInZhbHVlIiwic2xpY2UiLCJqb2luIiwicmVtb3ZlRW1wdHkiLCJkaWZmQXJyYXlzIiwib2xkQXJyIiwibmV3QXJyIiwiY2FsbGJhY2siLCJkaWZmIl0sIm1hcHBpbmdz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rKTsgfVxuIl19 - - -/***/ }), +convert.rgb.ansi256 = function (args) { + const r = args[0]; + const g = args[1]; + const b = args[2]; -/***/ 21653: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; -/*istanbul ignore start*/ + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (r === g && g === b) { + if (r < 8) { + return 16; + } + if (r > 248) { + return 231; + } -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.default = Diff; + return Math.round(((r - 8) / 247) * 24) + 232; + } -/*istanbul ignore end*/ -function Diff() {} + const ansi = 16 + + (36 * Math.round(r / 255 * 5)) + + (6 * Math.round(g / 255 * 5)) + + Math.round(b / 255 * 5); -Diff.prototype = { - /*istanbul ignore start*/ + return ansi; +}; - /*istanbul ignore end*/ - diff: function diff(oldString, newString) { - /*istanbul ignore start*/ - var - /*istanbul ignore end*/ - options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var callback = options.callback; +convert.ansi16.rgb = function (args) { + let color = args % 10; - if (typeof options === 'function') { - callback = options; - options = {}; - } + // Handle greyscale + if (color === 0 || color === 7) { + if (args > 50) { + color += 3.5; + } - this.options = options; - var self = this; + color = color / 10.5 * 255; - function done(value) { - if (callback) { - setTimeout(function () { - callback(undefined, value); - }, 0); - return true; - } else { - return value; - } - } // Allow subclasses to massage the input prior to running + return [color, color, color]; + } + const mult = (~~(args > 50) + 1) * 0.5; + const r = ((color & 1) * mult) * 255; + const g = (((color >> 1) & 1) * mult) * 255; + const b = (((color >> 2) & 1) * mult) * 255; - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, - oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - var bestPath = [{ - newPos: -1, - components: [] - }]; // Seed editLength = 0, i.e. the content starts with the same values + return [r, g, b]; +}; - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); +convert.ansi256.rgb = function (args) { + // Handle greyscale + if (args >= 232) { + const c = (args - 232) * 10 + 8; + return [c, c, c]; + } - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - // Identity per the equality and tokenizer - return done([{ - value: this.join(newString), - count: newString.length - }]); - } // Main worker method. checks all permutations of a given edit length for acceptance. + args -= 16; + let rem; + const r = Math.floor(args / 36) / 5 * 255; + const g = Math.floor((rem = args % 36) / 6) / 5 * 255; + const b = (rem % 6) / 5 * 255; - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = - /*istanbul ignore start*/ - void 0 - /*istanbul ignore end*/ - ; + return [r, g, b]; +}; - var addPath = bestPath[diagonalPath - 1], - removePath = bestPath[diagonalPath + 1], - _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; +convert.rgb.hex = function (args) { + const integer = ((Math.round(args[0]) & 0xFF) << 16) + + ((Math.round(args[1]) & 0xFF) << 8) + + (Math.round(args[2]) & 0xFF); - if (addPath) { - // No one else is going to attempt to use this value, clear it - bestPath[diagonalPath - 1] = undefined; - } + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; - var canAdd = addPath && addPath.newPos + 1 < newLen, - canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; +convert.hex.rgb = function (args) { + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } - if (!canAdd && !canRemove) { - // If this path is a terminal then prune - bestPath[diagonalPath] = undefined; - continue; - } // Select the diagonal that we want to branch from. We select the prior - // path whose position in the new string is the farthest from the origin - // and does not pass the bounds of the diff graph + let colorString = match[0]; + if (match[0].length === 3) { + colorString = colorString.split('').map(char => { + return char + char; + }).join(''); + } - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self.pushComponent(basePath.components, undefined, true); - } else { - basePath = addPath; // No need to clone, we've pulled it from the list + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 0xFF; + const g = (integer >> 8) & 0xFF; + const b = integer & 0xFF; - basePath.newPos++; - self.pushComponent(basePath.components, true, undefined); - } + return [r, g, b]; +}; - _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done +convert.rgb.hcg = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + const chroma = (max - min); + let grayscale; + let hue; - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); - } else { - // Otherwise track this path as a potential candidate and continue. - bestPath[diagonalPath] = basePath; - } - } + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } - editLength++; - } // Performs the length of edit iteration. Is a bit fugly as this has to support the - // sync and async mode which is never fun. Loops over execEditLength until a value - // is produced. + if (chroma <= 0) { + hue = 0; + } else + if (max === r) { + hue = ((g - b) / chroma) % 6; + } else + if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; + } + hue /= 6; + hue %= 1; - if (callback) { - (function exec() { - setTimeout(function () { - // This should not happen, but we want to be safe. + return [hue * 360, chroma * 100, grayscale * 100]; +}; - /* istanbul ignore next */ - if (editLength > maxEditLength) { - return callback(); - } +convert.hsl.hcg = function (hsl) { + const s = hsl[1] / 100; + const l = hsl[2] / 100; - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); + const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - if (ret) { - return ret; - } - } - } - }, + let f = 0; + if (c < 1.0) { + f = (l - 0.5 * c) / (1.0 - c); + } - /*istanbul ignore start*/ + return [hsl[0], c * 100, f * 100]; +}; - /*istanbul ignore end*/ - pushComponent: function pushComponent(components, added, removed) { - var last = components[components.length - 1]; +convert.hsv.hcg = function (hsv) { + const s = hsv[1] / 100; + const v = hsv[2] / 100; - if (last && last.added === added && last.removed === removed) { - // We need to clone here as the component clone operation is just - // as shallow array clone - components[components.length - 1] = { - count: last.count + 1, - added: added, - removed: removed - }; - } else { - components.push({ - count: 1, - added: added, - removed: removed - }); - } - }, + const c = s * v; + let f = 0; - /*istanbul ignore start*/ + if (c < 1.0) { + f = (v - c) / (1 - c); + } - /*istanbul ignore end*/ - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, - oldLen = oldString.length, - newPos = basePath.newPos, - oldPos = newPos - diagonalPath, - commonCount = 0; + return [hsv[0], c * 100, f * 100]; +}; - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } +convert.hcg.rgb = function (hcg) { + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } + if (c === 0.0) { + return [g * 255, g * 255, g * 255]; + } - basePath.newPos = newPos; - return oldPos; - }, + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; - /*istanbul ignore start*/ + /* eslint-disable max-statements-per-line */ + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; pure[1] = v; pure[2] = 0; break; + case 1: + pure[0] = w; pure[1] = 1; pure[2] = 0; break; + case 2: + pure[0] = 0; pure[1] = 1; pure[2] = v; break; + case 3: + pure[0] = 0; pure[1] = w; pure[2] = 1; break; + case 4: + pure[0] = v; pure[1] = 0; pure[2] = 1; break; + default: + pure[0] = 1; pure[1] = 0; pure[2] = w; + } + /* eslint-enable max-statements-per-line */ - /*istanbul ignore end*/ - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, + mg = (1.0 - c) * g; - /*istanbul ignore start*/ + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255 + ]; +}; - /*istanbul ignore end*/ - removeEmpty: function removeEmpty(array) { - var ret = []; +convert.hcg.hsv = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } + const v = c + g * (1.0 - c); + let f = 0; - return ret; - }, + if (v > 0.0) { + f = c / v; + } - /*istanbul ignore start*/ + return [hcg[0], f * 100, v * 100]; +}; - /*istanbul ignore end*/ - castInput: function castInput(value) { - return value; - }, +convert.hcg.hsl = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; - /*istanbul ignore start*/ + const l = g * (1.0 - c) + 0.5 * c; + let s = 0; - /*istanbul ignore end*/ - tokenize: function tokenize(value) { - return value.split(''); - }, + if (l > 0.0 && l < 0.5) { + s = c / (2 * l); + } else + if (l >= 0.5 && l < 1.0) { + s = c / (2 * (1 - l)); + } - /*istanbul ignore start*/ + return [hcg[0], s * 100, l * 100]; +}; - /*istanbul ignore end*/ - join: function join(chars) { - return chars.join(''); - } +convert.hcg.hwb = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1.0 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; -function buildValues(diff, components, newString, oldString, useLongestToken) { - var componentPos = 0, - componentLen = components.length, - newPos = 0, - oldPos = 0; +convert.hwb.hcg = function (hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; + if (c < 1) { + g = (v - c) / (1 - c); + } - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function (value, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value.length ? oldValue : value; - }); - component.value = diff.join(value); - } else { - component.value = diff.join(newString.slice(newPos, newPos + component.count)); - } + return [hwb[0], c * 100, g * 100]; +}; - newPos += component.count; // Common case +convert.apple.rgb = function (apple) { + return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; +}; - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; // Reverse add and remove so removes are output first to match common convention - // The diffing algorithm is tied to add then remove output and this is the simplest - // route to get the desired output with minimal overhead. +convert.rgb.apple = function (rgb) { + return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; +}; - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } // Special case handle for when one terminal is ignored (i.e. whitespace). - // For this case we merge the terminal into the prior string and drop the change. - // This is only available for string mode. +convert.gray.rgb = function (args) { + return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; +}; +convert.gray.hsl = function (args) { + return [0, 0, args[0]]; +}; - var lastComponent = components[componentLen - 1]; +convert.gray.hsv = convert.gray.hsl; - if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } +convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; +}; - return components; -} +convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; +}; -function clonePath(path) { - return { - newPos: path.newPos, - components: path.components.slice(0) - }; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOlsiRGlmZiIsInByb3RvdHlwZSIsImRpZmYiLCJvbGRTdHJpbmciLCJuZXdTdHJpbmciLCJvcHRpb25zIiwiY2FsbGJhY2siLCJzZWxmIiwiZG9uZSI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lbnRzW2NvbXBvbmVudExlbiAtIDFdO1xuICBpZiAoY29tcG9uZW50TGVuID4gMVxuICAgICAgJiYgdHlwZW9mIGxhc3RDb21wb25lbnQudmFsdWUgPT09ICdzdHJpbmcnXG4gICAgICAmJiAobGFzdENvbXBvbmVudC5hZGRlZCB8fCBsYXN0Q29tcG9uZW50LnJlbW92ZWQpXG4gICAgICAmJiBkaWZmLmVxdWFscygnJywgbGFzdENvbXBvbmVudC52YWx1ZSkpIHtcbiAgICBjb21wb25lbnRzW2NvbXBvbmVudExlbiAtIDJdLnZhbHVlICs9IGxhc3RDb21wb25lbnQudmFsdWU7XG4gICAgY29tcG9uZW50cy5wb3AoKTtcbiAgfVxuXG4gIHJldHVybiBjb21wb25lbnRzO1xufVxuXG5mdW5jdGlvbiBjbG9uZVBhdGgocGF0aCkge1xuICByZXR1cm4geyBuZXdQb3M6IHBhdGgubmV3UG9zLCBjb21wb25lbnRzOiBwYXRoLmNvbXBvbmVudHMuc2xpY2UoMCkgfTtcbn1cbiJdfQ== +convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; +}; +convert.gray.hex = function (gray) { + const val = Math.round(gray[0] / 100 * 255) & 0xFF; + const integer = (val << 16) + (val << 8) + val; -/***/ }), + const string = integer.toString(16).toUpperCase(); + return '000000'.substring(string.length) + string; +}; -/***/ 22081: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +convert.rgb.gray = function (rgb) { + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val / 255 * 100]; +}; -"use strict"; -/*istanbul ignore start*/ +/***/ }), -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.diffChars = diffChars; -exports.characterDiff = void 0; +/***/ 86931: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(__nccwpck_require__(21653)) -/*istanbul ignore end*/ -; +const conversions = __nccwpck_require__(97391); +const route = __nccwpck_require__(30880); -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +const convert = {}; -/*istanbul ignore end*/ -var characterDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -[ -/*istanbul ignore start*/ -"default" -/*istanbul ignore end*/ -](); +const models = Object.keys(conversions); -/*istanbul ignore start*/ -exports.characterDiff = characterDiff; - -/*istanbul ignore end*/ -function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6WyJjaGFyYWN0ZXJEaWZmIiwiRGlmZiIsImRpZmZDaGFycyIsIm9sZFN0ciIsIm5ld1N0ciIsIm9wdGlvbnMiLCJkaWZmIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTs7Ozs7QUFFTyxJQUFNQSxhQUFhLEdBQUc7QUFBSUM7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUEsQ0FBSixFQUF0Qjs7Ozs7O0FBQ0EsU0FBU0MsU0FBVCxDQUFtQkMsTUFBbkIsRUFBMkJDLE1BQTNCLEVBQW1DQyxPQUFuQyxFQUE0QztBQUFFLFNBQU9MLGFBQWEsQ0FBQ00sSUFBZCxDQUFtQkgsTUFBbkIsRUFBMkJDLE1BQTNCLEVBQW1DQyxPQUFuQyxDQUFQO0FBQXFEIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcblxuZXhwb3J0IGNvbnN0IGNoYXJhY3RlckRpZmYgPSBuZXcgRGlmZigpO1xuZXhwb3J0IGZ1bmN0aW9uIGRpZmZDaGFycyhvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucykgeyByZXR1cm4gY2hhcmFjdGVyRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTsgfVxuIl19 +function wrapRaw(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; + if (arg0 === undefined || arg0 === null) { + return arg0; + } + if (arg0.length > 1) { + args = arg0; + } -/***/ }), + return fn(args); + }; -/***/ 48941: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } -"use strict"; -/*istanbul ignore start*/ + return wrappedFn; +} +function wrapRounded(fn) { + const wrappedFn = function (...args) { + const arg0 = args[0]; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.diffCss = diffCss; -exports.cssDiff = void 0; + if (arg0 === undefined || arg0 === null) { + return arg0; + } -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(__nccwpck_require__(21653)) -/*istanbul ignore end*/ -; + if (arg0.length > 1) { + args = arg0; + } -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + const result = fn(args); -/*istanbul ignore end*/ -var cssDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -[ -/*istanbul ignore start*/ -"default" -/*istanbul ignore end*/ -](); + // We're assuming the result is an array here. + // see notice in conversions.js; don't use box types + // in conversion functions. + if (typeof result === 'object') { + for (let len = result.length, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } -/*istanbul ignore start*/ -exports.cssDiff = cssDiff; + return result; + }; -/*istanbul ignore end*/ -cssDiff.tokenize = function (value) { - return value.split(/([{}:;,]|\s+)/); -}; + // Preserve .conversion property if there is one + if ('conversion' in fn) { + wrappedFn.conversion = fn.conversion; + } -function diffCss(oldStr, newStr, callback) { - return cssDiff.diff(oldStr, newStr, callback); + return wrappedFn; } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbI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] = {}; -/***/ }), - -/***/ 86335: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); + Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); -"use strict"; -/*istanbul ignore start*/ + const routes = route(fromModel); + const routeModels = Object.keys(routes); + routeModels.forEach(toModel => { + const fn = routes[toModel]; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.diffJson = diffJson; -exports.canonicalize = canonicalize; -exports.jsonDiff = void 0; + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); +}); -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(__nccwpck_require__(21653)) -/*istanbul ignore end*/ -; +module.exports = convert; -var -/*istanbul ignore start*/ -_line = __nccwpck_require__(41591) -/*istanbul ignore end*/ -; -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +/***/ }), -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +/***/ 30880: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/*istanbul ignore end*/ -var objectPrototypeToString = Object.prototype.toString; -var jsonDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -[ -/*istanbul ignore start*/ -"default" -/*istanbul ignore end*/ -](); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a -// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: +const conversions = __nccwpck_require__(97391); -/*istanbul ignore start*/ -exports.jsonDiff = jsonDiff; +/* + This function routes a model to all other models. -/*istanbul ignore end*/ -jsonDiff.useLongestToken = true; -jsonDiff.tokenize = -/*istanbul ignore start*/ -_line -/*istanbul ignore end*/ -. -/*istanbul ignore start*/ -lineDiff -/*istanbul ignore end*/ -.tokenize; + all functions that are routed have a property `.conversion` attached + to the returned synthetic function. This property is an array + of strings, each with the steps in between the 'from' and 'to' + color models (inclusive). -jsonDiff.castInput = function (value) { - /*istanbul ignore start*/ - var _this$options = - /*istanbul ignore end*/ - this.options, - undefinedReplacement = _this$options.undefinedReplacement, - _this$options$stringi = _this$options.stringifyReplacer, - stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) - /*istanbul ignore start*/ - { - return ( - /*istanbul ignore end*/ - typeof v === 'undefined' ? undefinedReplacement : v - ); - } : _this$options$stringi; - return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); -}; + conversions that are not possible simply are not included. +*/ -jsonDiff.equals = function (left, right) { - return ( - /*istanbul ignore start*/ - _base - /*istanbul ignore end*/ - [ - /*istanbul ignore start*/ - "default" - /*istanbul ignore end*/ - ].prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')) - ); -}; +function buildGraph() { + const graph = {}; + // https://jsperf.com/object-keys-vs-for-in-with-closure/3 + const models = Object.keys(conversions); -function diffJson(oldObj, newObj, options) { - return jsonDiff.diff(oldObj, newObj, options); -} // This function handles the presence of circular references by bailing out when encountering an -// object that is already on the "stack" of items being processed. Accepts an optional replacer + for (let len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + return graph; +} -function canonicalize(obj, stack, replacementStack, replacer, key) { - stack = stack || []; - replacementStack = replacementStack || []; +// https://en.wikipedia.org/wiki/Breadth-first_search +function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; // Unshift -> queue -> pop - if (replacer) { - obj = replacer(key, obj); - } + graph[fromModel].distance = 0; - var i; + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; - var canonicalizedObj; + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } - if ('[object Array]' === objectPrototypeToString.call(obj)) { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); + return graph; +} - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); - } +function link(from, to) { + return function (args) { + return to(from(args)); + }; +} - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } +function wrapConversion(toModel, graph) { + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } - if ( - /*istanbul ignore start*/ - _typeof( - /*istanbul ignore end*/ - obj) === 'object' && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); + fn.conversion = path; + return fn; +} - var sortedKeys = [], - _key; +module.exports = function (fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; - for (_key in obj) { - /* istanbul ignore else */ - if (obj.hasOwnProperty(_key)) { - sortedKeys.push(_key); - } - } + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; - sortedKeys.sort(); + if (node.parent === null) { + // No possible conversion, or this node is the source model. + continue; + } - for (i = 0; i < sortedKeys.length; i += 1) { - _key = sortedKeys[i]; - canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); - } + conversion[toModel] = wrapConversion(toModel, graph); + } - stack.pop(); - replacementStack.pop(); - } else { - canonicalizedObj = obj; - } + return conversion; +}; - return canonicalizedObj; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOlsib2JqZWN0UHJvdG90eXBlVG9TdHJpbmciLCJPYmplY3QiLCJwcm90b3R5cGUiLCJ0b1N0cmluZyIsImpzb25EaWZmIiwiRGlmZiIsInVzZUxvbmdlc3RUb2tlbiIsInRva2VuaXplIiwibGluZURpZmYiLCJjYXN0SW5wdXQiLCJ2YWx1ZSIsIm9wdGlvbnMiLCJ1bmRlZmluZWRSZXBsYWNlbWVudCIsInN0cmluZ2lmeVJlcGxhY2VyIiwiayIsInYiLCJKU09OIiwic3RyaW5naWZ5IiwiY2Fub25pY2FsaXplIiwiZXF1YWxzIiwibGVmdCIsInJpZ2h0IiwiY2FsbCIsInJlcGxhY2UiLCJkaWZmSnNvbiIsIm9sZE9iaiIsIm5ld09iaiIsImRpZmYiLCJvYmoiLCJzdGFjayIsInJlcGxhY2VtZW50U3RhY2siLCJyZXBsYWNlciIsImtleSIsImkiLCJsZW5ndGgiLCJjYW5vbmljYWxpemVkT2JqIiwicHVzaCIsIkFycmF5IiwicG9wIiwidG9KU09OIiwic29ydGVkS2V5cyIsImhhc093blByb3BlcnR5Iiwic29ydCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOztBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQUE7Ozs7Ozs7QUFFQSxJQUFNQSx1QkFBdUIsR0FBR0MsTUFBTSxDQUFDQyxTQUFQLENBQWlCQyxRQUFqRDtBQUdPLElBQU1DLFFBQVEsR0FBRztBQUFJQztBQUFBQTtBQUFBQTtBQUFBQTtBQUFBQTtBQUFBQTtBQUFBQTtBQUFBQSxDQUFKLEVBQWpCLEMsQ0FDUDtBQUNBOzs7Oz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bGl6ZWRPYmo7XG59XG4iXX0= /***/ }), -/***/ 41591: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 78510: +/***/ ((module) => { "use strict"; -/*istanbul ignore start*/ - + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.diffLines = diffLines; -exports.diffTrimmedLines = diffTrimmedLines; -exports.lineDiff = void 0; -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(__nccwpck_require__(21653)) -/*istanbul ignore end*/ -; +/***/ }), -var -/*istanbul ignore start*/ -_params = __nccwpck_require__(45704) -/*istanbul ignore end*/ -; +/***/ 24623: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +"use strict"; -/*istanbul ignore end*/ -var lineDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -[ -/*istanbul ignore start*/ -"default" -/*istanbul ignore end*/ -](); +var arrayify = __nccwpck_require__(28912); +var dotPropGet = __nccwpck_require__(82042).get; -/*istanbul ignore start*/ -exports.lineDiff = lineDiff; +function compareFunc(prop) { + return function(a, b) { + var ret = 0; -/*istanbul ignore end*/ -lineDiff.tokenize = function (value) { - var retLines = [], - linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line + arrayify(prop).some(function(el) { + var x; + var y; - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } // Merge the content and line separators into single tokens - - - for (var i = 0; i < linesAndNewlines.length; i++) { - var line = linesAndNewlines[i]; + if (typeof el === 'function') { + x = el(a); + y = el(b); + } else if (typeof el === 'string') { + x = dotPropGet(a, el); + y = dotPropGet(b, el); + } else { + x = a; + y = b; + } - if (i % 2 && !this.options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } else { - if (this.options.ignoreWhitespace) { - line = line.trim(); + if (x === y) { + ret = 0; + return; } - retLines.push(line); - } - } + if (typeof x === 'string' && typeof y === 'string') { + ret = x.localeCompare(y); + return ret !== 0; + } - return retLines; -}; + ret = x < y ? -1 : 1; + return true; + }); -function diffLines(oldStr, newStr, callback) { - return lineDiff.diff(oldStr, newStr, callback); + return ret; + }; } -function diffTrimmedLines(oldStr, newStr, callback) { - var options = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _params - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - generateOptions) - /*istanbul ignore end*/ - (callback, { - ignoreWhitespace: true - }); - return lineDiff.diff(oldStr, newStr, options); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOlsibGluZURpZmYiLCJEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsInJldExpbmVzIiwibGluZXNBbmROZXdsaW5lcyIsInNwbGl0IiwibGVuZ3RoIiwicG9wIiwiaSIsImxpbmUiLCJvcHRpb25zIiwibmV3bGluZUlzVG9rZW4iLCJpZ25vcmVXaGl0ZXNwYWNlIiwidHJpbSIsInB1c2giLCJkaWZmTGluZXMiLCJvbGRTdHIiL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mVHJpbW1lZExpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykge1xuICBsZXQgb3B0aW9ucyA9IGdlbmVyYXRlT3B0aW9ucyhjYWxsYmFjaywge2lnbm9yZVdoaXRlc3BhY2U6IHRydWV9KTtcbiAgcmV0dXJuIGxpbmVEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIG9wdGlvbnMpO1xufVxuIl19 +module.exports = compareFunc; /***/ }), -/***/ 33577: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 73645: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/*istanbul ignore start*/ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.diffSentences = diffSentences; -exports.sentenceDiff = void 0; +// These tables borrowed from `ansi` -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(__nccwpck_require__(21653)) -/*istanbul ignore end*/ -; +var prefix = '\x1b[' -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} -/*istanbul ignore end*/ -var sentenceDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -[ -/*istanbul ignore start*/ -"default" -/*istanbul ignore end*/ -](); +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} -/*istanbul ignore start*/ -exports.sentenceDiff = sentenceDiff; +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} -/*istanbul ignore end*/ -sentenceDiff.tokenize = function (value) { - return value.split(/(\S.+?[.!?])(?=\s+|$)/); -}; +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} -function diffSentences(oldStr, newStr, callback) { - return sentenceDiff.diff(oldStr, newStr, callback); +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3N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RyLCBjYWxsYmFjayk7IH1cbiJdfQ== +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} -/***/ }), +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} -/***/ 46992: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +exports.eraseData = function eraseData () { + return prefix + 'J' +} -"use strict"; -/*istanbul ignore start*/ +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.diffWords = diffWords; -exports.diffWordsWithSpace = diffWordsWithSpace; -exports.wordDiff = void 0; +exports.gotoSOL = function () { + return '\r' +} -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(__nccwpck_require__(21653)) -/*istanbul ignore end*/ -; +exports.beep = function () { + return '\x07' +} -var -/*istanbul ignore start*/ -_params = __nccwpck_require__(45704) -/*istanbul ignore end*/ -; +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +exports.showCursor = function showCursor () { + return prefix + '?25h' +} -/*istanbul ignore end*/ -// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode -// -// Ranges and exceptions: -// Latin-1 Supplement, 0080–00FF -// - U+00D7 × Multiplication sign -// - U+00F7 ÷ Division sign -// Latin Extended-A, 0100–017F -// Latin Extended-B, 0180–024F -// IPA Extensions, 0250–02AF -// Spacing Modifier Letters, 02B0–02FF -// - U+02C7 ˇ ˇ Caron -// - U+02D8 ˘ ˘ Breve -// - U+02D9 ˙ ˙ Dot Above -// - U+02DA ˚ ˚ Ring Above -// - U+02DB ˛ ˛ Ogonek -// - U+02DC ˜ ˜ Small Tilde -// - U+02DD ˝ ˝ Double Acute Accent -// Latin Extended Additional, 1E00–1EFF -var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; -var reWhitespace = /\S/; -var wordDiff = new -/*istanbul ignore start*/ -_base -/*istanbul ignore end*/ -[ -/*istanbul ignore start*/ -"default" -/*istanbul ignore end*/ -](); +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, -/*istanbul ignore start*/ -exports.wordDiff = wordDiff; + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, -/*istanbul ignore end*/ -wordDiff.equals = function (left, right) { - if (this.options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} - return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); -}; +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} -wordDiff.tokenize = function (value) { - // All whitespace symbols except newline group into one token, each newline - in separate token - var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} - for (var i = 0; i < tokens.length - 1; i++) { - // If we have an empty string in the next field and we have only word chars before and after, merge - if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { - tokens[i] += tokens[i + 2]; - tokens.splice(i + 1, 2); - i--; - } - } - return tokens; -}; +/***/ }), -function diffWords(oldStr, newStr, options) { - options = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ +/***/ 82429: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /*istanbul ignore start*/ - _params - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - generateOptions) - /*istanbul ignore end*/ - (options, { - ignoreWhitespace: true - }); - return wordDiff.diff(oldStr, newStr, options); -} +const { breakingHeaderPattern } = __nccwpck_require__(88236)() -function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); +module.exports = (commit) => { + const match = commit.header.match(breakingHeaderPattern) + if (match && commit.notes.length === 0) { + const noteText = match[3] // the description of the change. + commit.notes.push({ + text: noteText + }) + } } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOlsiZXh0ZW5kZWRXb3JkQ2hhcnMiLCJyZVdoaXRlc3BhY2UiLCJ3b3JkRGlmZiIsIkRpZmYiLCJlcXVhbHMiLCJsZWZ0IiwicmlnaHQiLCJvcHRpb25zIiwiaWdub3JlQ2FzZSIsInRvTG93ZXJDYXNlIiwiaWdub3JlV2hpdGVzcGFjZSIsInRlc3QiLCJ0b2tlbml6ZSIsInZhbHVlIiwidG9rZW5zIiwic3BsaXQiLCJpIiwibGVuZ3RoIiwic3BsaWNlIiwiZGlmZldvcmRzIiwib2xkU3RyIiwibmV3U3RyIiwiZ2VuZXJhdGVPcHRpb25zIiwiZGlmZiIsImRpZmZXb3Jkc1dpdGhTcGFjZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7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ld1N0ciwgb3B0aW9ucyk7XG59XG4iXX0= /***/ }), -/***/ 71672: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 87333: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/*istanbul ignore start*/ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -Object.defineProperty(exports, "Diff", ({ - enumerable: true, - get: function get() { - return _base["default"]; - } -})); -Object.defineProperty(exports, "diffChars", ({ - enumerable: true, - get: function get() { - return _character.diffChars; - } -})); -Object.defineProperty(exports, "diffWords", ({ - enumerable: true, - get: function get() { - return _word.diffWords; - } -})); -Object.defineProperty(exports, "diffWordsWithSpace", ({ - enumerable: true, - get: function get() { - return _word.diffWordsWithSpace; - } -})); -Object.defineProperty(exports, "diffLines", ({ - enumerable: true, - get: function get() { - return _line.diffLines; - } -})); -Object.defineProperty(exports, "diffTrimmedLines", ({ - enumerable: true, - get: function get() { - return _line.diffTrimmedLines; - } -})); -Object.defineProperty(exports, "diffSentences", ({ - enumerable: true, - get: function get() { - return _sentence.diffSentences; - } -})); -Object.defineProperty(exports, "diffCss", ({ - enumerable: true, - get: function get() { - return _css.diffCss; - } -})); -Object.defineProperty(exports, "diffJson", ({ - enumerable: true, - get: function get() { - return _json.diffJson; - } -})); -Object.defineProperty(exports, "canonicalize", ({ - enumerable: true, - get: function get() { - return _json.canonicalize; - } -})); -Object.defineProperty(exports, "diffArrays", ({ - enumerable: true, - get: function get() { - return _array.diffArrays; - } -})); -Object.defineProperty(exports, "applyPatch", ({ - enumerable: true, - get: function get() { - return _apply.applyPatch; - } -})); -Object.defineProperty(exports, "applyPatches", ({ - enumerable: true, - get: function get() { - return _apply.applyPatches; - } -})); -Object.defineProperty(exports, "parsePatch", ({ - enumerable: true, - get: function get() { - return _parse.parsePatch; - } -})); -Object.defineProperty(exports, "merge", ({ - enumerable: true, - get: function get() { - return _merge.merge; - } -})); -Object.defineProperty(exports, "structuredPatch", ({ - enumerable: true, - get: function get() { - return _create.structuredPatch; - } -})); -Object.defineProperty(exports, "createTwoFilesPatch", ({ - enumerable: true, - get: function get() { - return _create.createTwoFilesPatch; - } -})); -Object.defineProperty(exports, "createPatch", ({ - enumerable: true, - get: function get() { - return _create.createPatch; - } -})); -Object.defineProperty(exports, "convertChangesToDMP", ({ - enumerable: true, - get: function get() { - return _dmp.convertChangesToDMP; - } -})); -Object.defineProperty(exports, "convertChangesToXML", ({ - enumerable: true, - get: function get() { - return _xml.convertChangesToXML; - } -})); - -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_base = _interopRequireDefault(__nccwpck_require__(21653)) -/*istanbul ignore end*/ -; +const Q = __nccwpck_require__(56172) +const parserOpts = __nccwpck_require__(88236) +const writerOpts = __nccwpck_require__(10382) -var -/*istanbul ignore start*/ -_character = __nccwpck_require__(22081) -/*istanbul ignore end*/ -; +module.exports = function (config) { + return Q.all([parserOpts(config), writerOpts(config)]) + .spread((parserOpts, writerOpts) => { + return { parserOpts, writerOpts } + }) +} -var -/*istanbul ignore start*/ -_word = __nccwpck_require__(46992) -/*istanbul ignore end*/ -; -var -/*istanbul ignore start*/ -_line = __nccwpck_require__(41591) -/*istanbul ignore end*/ -; +/***/ }), -var -/*istanbul ignore start*/ -_sentence = __nccwpck_require__(33577) -/*istanbul ignore end*/ -; +/***/ 97620: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var -/*istanbul ignore start*/ -_css = __nccwpck_require__(48941) -/*istanbul ignore end*/ -; +"use strict"; -var -/*istanbul ignore start*/ -_json = __nccwpck_require__(86335) -/*istanbul ignore end*/ -; -var -/*istanbul ignore start*/ -_array = __nccwpck_require__(70546) -/*istanbul ignore end*/ -; +const addBangNotes = __nccwpck_require__(82429) +const parserOpts = __nccwpck_require__(88236) -var -/*istanbul ignore start*/ -_apply = __nccwpck_require__(17429) -/*istanbul ignore end*/ -; +module.exports = function (config) { + return { + parserOpts: parserOpts(config), -var -/*istanbul ignore start*/ -_parse = __nccwpck_require__(15870) -/*istanbul ignore end*/ -; + whatBump: (commits) => { + let level = 2 + let breakings = 0 + let features = 0 -var -/*istanbul ignore start*/ -_merge = __nccwpck_require__(22640) -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_create = __nccwpck_require__(64543) -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_dmp = __nccwpck_require__(32859) -/*istanbul ignore end*/ -; - -var -/*istanbul ignore start*/ -_xml = __nccwpck_require__(16982) -/*istanbul ignore end*/ -; + commits.forEach(commit => { + // adds additional breaking change notes + // for the special case, test(system)!: hello world, where there is + // a '!' but no 'BREAKING CHANGE' in body: + addBangNotes(commit) + if (commit.notes.length > 0) { + breakings += commit.notes.length + level = 0 + } else if (commit.type === 'feat' || commit.type === 'feature') { + features += 1 + if (level === 2) { + level = 1 + } + } + }) -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + if (config.preMajor && level < 2) { + level++ + } -/*istanbul ignore end*/ -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWdCQTtBQUFBO0FBQUE7QUFBQTtBQUFBOztBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQUE7O0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTs7QUFDQTtBQUFBO0FBQUE7QUFBQTtBQUFBOztBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQUE7O0FBRUE7QUFBQTtBQ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aW5lcyxcbiAgZGlmZlRyaW1tZWRMaW5lcyxcbiAgZGlmZlNlbnRlbmNlcyxcblxuICBkaWZmQ3NzLFxuICBkaWZmSnNvbixcblxuICBkaWZmQXJyYXlzLFxuXG4gIHN0cnVjdHVyZWRQYXRjaCxcbiAgY3JlYXRlVHdvRmlsZXNQYXRjaCxcbiAgY3JlYXRlUGF0Y2gsXG4gIGFwcGx5UGF0Y2gsXG4gIGFwcGx5UGF0Y2hlcyxcbiAgcGFyc2VQYXRjaCxcbiAgbWVyZ2UsXG4gIGNvbnZlcnRDaGFuZ2VzVG9ETVAsXG4gIGNvbnZlcnRDaGFuZ2VzVG9YTUwsXG4gIGNhbm9uaWNhbGl6ZVxufTtcbiJdfQ== + return { + level: level, + reason: breakings === 1 + ? `There is ${breakings} BREAKING CHANGE and ${features} features` + : `There are ${breakings} BREAKING CHANGES and ${features} features` + } + } + } +} /***/ }), -/***/ 17429: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 88761: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/*istanbul ignore start*/ +const Q = __nccwpck_require__(56172) +const _ = __nccwpck_require__(90250) +const conventionalChangelog = __nccwpck_require__(87333) +const parserOpts = __nccwpck_require__(88236) +const recommendedBumpOpts = __nccwpck_require__(97620) +const writerOpts = __nccwpck_require__(10382) -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.applyPatch = applyPatch; -exports.applyPatches = applyPatches; +module.exports = function (parameter) { + // parameter passed can be either a config object or a callback function + if (_.isFunction(parameter)) { + // parameter is a callback object + const config = {} + // FIXME: use presetOpts(config) for callback + Q.all([ + conventionalChangelog(config), + parserOpts(config), + recommendedBumpOpts(config), + writerOpts(config) + ]).spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { + parameter(null, { gitRawCommitsOpts: { noMerges: null }, conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts }) + }) + } else { + const config = parameter || {} + return presetOpts(config) + } +} -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_parse = __nccwpck_require__(15870) -/*istanbul ignore end*/ -; +function presetOpts (config) { + return Q.all([ + conventionalChangelog(config), + parserOpts(config), + recommendedBumpOpts(config), + writerOpts(config) + ]).spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { + return { conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts } + }) +} -var -/*istanbul ignore start*/ -_distanceIterator = _interopRequireDefault(__nccwpck_require__(75512)) -/*istanbul ignore end*/ -; -/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } +/***/ }), -/*istanbul ignore end*/ -function applyPatch(source, uniDiff) { - /*istanbul ignore start*/ - var - /*istanbul ignore end*/ - options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; +/***/ 88236: +/***/ ((module) => { - if (typeof uniDiff === 'string') { - uniDiff = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ +"use strict"; - /*istanbul ignore start*/ - _parse - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - parsePatch) - /*istanbul ignore end*/ - (uniDiff); - } - if (Array.isArray(uniDiff)) { - if (uniDiff.length > 1) { - throw new Error('applyPatch only works with a single input.'); - } +module.exports = function (config) { + config = defaultConfig(config) + return { + headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/, + breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/, + headerCorrespondence: [ + 'type', + 'scope', + 'subject' + ], + noteKeywords: ['BREAKING CHANGE', 'BREAKING-CHANGE'], + revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i, + revertCorrespondence: ['header', 'hash'], + issuePrefixes: config.issuePrefixes + } +} - uniDiff = uniDiff[0]; - } // Apply the diff to the input +// merge user set configuration with default configuration. +function defaultConfig (config) { + config = config || {} + config.issuePrefixes = config.issuePrefixes || ['#'] + return config +} - var lines = source.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], - hunks = uniDiff.hunks, - compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) - /*istanbul ignore start*/ - { - return ( - /*istanbul ignore end*/ - line === patchContent - ); - }, - errorCount = 0, - fuzzFactor = options.fuzzFactor || 0, - minLine = 0, - offset = 0, - removeEOFNL, - addEOFNL; - /** - * Checks if the hunk exactly fits on the provided location - */ +/***/ }), +/***/ 10382: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - function hunkFits(hunk, toPos) { - for (var j = 0; j < hunk.lines.length; j++) { - var line = hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line; +"use strict"; - if (operation === ' ' || operation === '-') { - // Context sanity check - if (!compareLine(toPos + 1, lines[toPos], operation, content)) { - errorCount++; - if (errorCount > fuzzFactor) { - return false; - } - } +const addBangNotes = __nccwpck_require__(82429) +const compareFunc = __nccwpck_require__(24623) +const Q = __nccwpck_require__(56172) +const readFile = Q.denodeify(__nccwpck_require__(35747).readFile) +const resolve = __nccwpck_require__(85622).resolve +const releaseAsRe = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i - toPos++; - } - } +/** + * Handlebar partials for various property substitutions based on commit context. + */ +const owner = '{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}' +const host = '{{~@root.host}}' +const repository = '{{#if this.repository}}{{~this.repository}}{{else}}{{~@root.repository}}{{/if}}' - return true; - } // Search best fit offsets for each hunk based on the previous ones +module.exports = function (config) { + config = defaultConfig(config) + const commitUrlFormat = expandTemplate(config.commitUrlFormat, { + host, + owner, + repository + }) + const compareUrlFormat = expandTemplate(config.compareUrlFormat, { + host, + owner, + repository + }) + const issueUrlFormat = expandTemplate(config.issueUrlFormat, { + host, + owner, + repository, + id: '{{this.issue}}', + prefix: '{{this.prefix}}' + }) + return Q.all([ + readFile(__nccwpck_require__.ab + "template2.hbs", 'utf-8'), + readFile(__nccwpck_require__.ab + "header2.hbs", 'utf-8'), + readFile(__nccwpck_require__.ab + "commit2.hbs", 'utf-8'), + readFile(__nccwpck_require__.ab + "footer1.hbs", 'utf-8') + ]) + .spread((template, header, commit, footer) => { + const writerOpts = getWriterOpts(config) - for (var i = 0; i < hunks.length; i++) { - var hunk = hunks[i], - maxLine = lines.length - hunk.oldLines, - localOffset = 0, - toPos = offset + hunk.oldStart - 1; - var iterator = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ + writerOpts.mainTemplate = template + writerOpts.headerPartial = header + .replace(/{{compareUrlFormat}}/g, compareUrlFormat) + writerOpts.commitPartial = commit + .replace(/{{commitUrlFormat}}/g, commitUrlFormat) + .replace(/{{issueUrlFormat}}/g, issueUrlFormat) + writerOpts.footerPartial = footer - /*istanbul ignore start*/ - _distanceIterator - /*istanbul ignore end*/ - [ - /*istanbul ignore start*/ - "default" - /*istanbul ignore end*/ - ])(toPos, minLine, maxLine); + return writerOpts + }) +} - for (; localOffset !== undefined; localOffset = iterator()) { - if (hunkFits(hunk, toPos + localOffset)) { - hunk.offset = offset += localOffset; - break; - } +function findTypeEntry (types, commit) { + const typeKey = (commit.revert ? 'revert' : (commit.type || '')).toLowerCase() + return types.find((entry) => { + if (entry.type !== typeKey) { + return false } + if (entry.scope && entry.scope !== commit.scope) { + return false + } + return true + }) +} - if (localOffset === undefined) { - return false; - } // Set lower text limit to end of the current hunk, so next ones don't try - // to fit over already patched text - - - minLine = hunk.offset + hunk.oldStart + hunk.oldLines; - } // Apply patch hunks +function getWriterOpts (config) { + config = defaultConfig(config) + return { + transform: (commit, context) => { + let discard = true + const issues = [] + const entry = findTypeEntry(config.types, commit) - var diffOffset = 0; + // adds additional breaking change notes + // for the special case, test(system)!: hello world, where there is + // a '!' but no 'BREAKING CHANGE' in body: + addBangNotes(commit) - for (var _i = 0; _i < hunks.length; _i++) { - var _hunk = hunks[_i], - _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; + // Add an entry in the CHANGELOG if special Release-As footer + // is used: + if ((commit.footer && releaseAsRe.test(commit.footer)) || + (commit.body && releaseAsRe.test(commit.body))) { + discard = false + } - diffOffset += _hunk.newLines - _hunk.oldLines; + commit.notes.forEach(note => { + note.title = 'BREAKING CHANGES' + discard = false + }) - for (var j = 0; j < _hunk.lines.length; j++) { - var line = _hunk.lines[j], - operation = line.length > 0 ? line[0] : ' ', - content = line.length > 0 ? line.substr(1) : line, - delimiter = _hunk.linedelimiters[j]; + // breaking changes attached to any type are still displayed. + if (discard && (entry === undefined || + entry.hidden)) return - if (operation === ' ') { - _toPos++; - } else if (operation === '-') { - lines.splice(_toPos, 1); - delimiters.splice(_toPos, 1); - /* istanbul ignore else */ - } else if (operation === '+') { - lines.splice(_toPos, 0, content); - delimiters.splice(_toPos, 0, delimiter); - _toPos++; - } else if (operation === '\\') { - var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; + if (entry) commit.type = entry.section - if (previousOperation === '+') { - removeEOFNL = true; - } else if (previousOperation === '-') { - addEOFNL = true; - } + if (commit.scope === '*') { + commit.scope = '' } - } - } // Handle EOFNL insertion/removal - - - if (removeEOFNL) { - while (!lines[lines.length - 1]) { - lines.pop(); - delimiters.pop(); - } - } else if (addEOFNL) { - lines.push(''); - delimiters.push('\n'); - } - - for (var _k = 0; _k < lines.length - 1; _k++) { - lines[_k] = lines[_k] + delimiters[_k]; - } - return lines.join(''); -} // Wrapper that supports multiple file patches via callbacks. + if (typeof commit.hash === 'string') { + commit.shortHash = commit.hash.substring(0, 7) + } + if (typeof commit.subject === 'string') { + // Issue URLs. + config.issuePrefixes.join('|') + const issueRegEx = '(' + config.issuePrefixes.join('|') + ')' + '([0-9]+)' + const re = new RegExp(issueRegEx, 'g') -function applyPatches(uniDiff, options) { - if (typeof uniDiff === 'string') { - uniDiff = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ + commit.subject = commit.subject.replace(re, (_, prefix, issue) => { + issues.push(prefix + issue) + const url = expandTemplate(config.issueUrlFormat, { + host: context.host, + owner: context.owner, + repository: context.repository, + id: issue, + prefix: prefix + }) + return `[${prefix}${issue}](${url})` + }) + // User URLs. + commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, user) => { + // TODO: investigate why this code exists. + if (user.includes('/')) { + return `@${user}` + } - /*istanbul ignore start*/ - _parse - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - parsePatch) - /*istanbul ignore end*/ - (uniDiff); - } + const usernameUrl = expandTemplate(config.userUrlFormat, { + host: context.host, + owner: context.owner, + repository: context.repository, + user: user + }) - var currentIndex = 0; + return `[@${user}](${usernameUrl})` + }) + } - function processIndex() { - var index = uniDiff[currentIndex++]; + // remove references that already appear in the subject + commit.references = commit.references.filter(reference => { + if (issues.indexOf(reference.prefix + reference.issue) === -1) { + return true + } - if (!index) { - return options.complete(); - } + return false + }) - options.loadFile(index, function (err, data) { - if (err) { - return options.complete(err); + return commit + }, + groupBy: 'type', + // the groupings of commit messages, e.g., Features vs., Bug Fixes, are + // sorted based on their probable importance: + commitGroupsSort: (a, b) => { + const commitGroupOrder = ['Reverts', 'Performance Improvements', 'Bug Fixes', 'Features'] + const gRankA = commitGroupOrder.indexOf(a.title) + const gRankB = commitGroupOrder.indexOf(b.title) + if (gRankA >= gRankB) { + return -1 + } else { + return 1 } + }, + commitsSort: ['scope', 'subject'], + noteGroupsSort: 'title', + notesSort: compareFunc + } +} - var updatedContent = applyPatch(data, index, options); - options.patched(index, updatedContent, function (err) { - if (err) { - return options.complete(err); - } +// merge user set configuration with default configuration. +function defaultConfig (config) { + config = config || {} + config.types = config.types || [ + { type: 'feat', section: 'Features' }, + { type: 'feature', section: 'Features' }, + { type: 'fix', section: 'Bug Fixes' }, + { type: 'perf', section: 'Performance Improvements' }, + { type: 'revert', section: 'Reverts' }, + { type: 'docs', section: 'Documentation', hidden: true }, + { type: 'style', section: 'Styles', hidden: true }, + { type: 'chore', section: 'Miscellaneous Chores', hidden: true }, + { type: 'refactor', section: 'Code Refactoring', hidden: true }, + { type: 'test', section: 'Tests', hidden: true }, + { type: 'build', section: 'Build System', hidden: true }, + { type: 'ci', section: 'Continuous Integration', hidden: true } + ] + config.issueUrlFormat = config.issueUrlFormat || + '{{host}}/{{owner}}/{{repository}}/issues/{{id}}' + config.commitUrlFormat = config.commitUrlFormat || + '{{host}}/{{owner}}/{{repository}}/commit/{{hash}}' + config.compareUrlFormat = config.compareUrlFormat || + '{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}' + config.userUrlFormat = config.userUrlFormat || + '{{host}}/{{user}}' + config.issuePrefixes = config.issuePrefixes || ['#'] - processIndex(); - }); - }); - } + return config +} - processIndex(); +// expand on the simple mustache-style templates supported in +// configuration (we may eventually want to use handlebars for this). +function expandTemplate (template, context) { + let expanded = template + Object.keys(context).forEach(key => { + expanded = expanded.replace(new RegExp(`{{${key}}}`, 'g'), context[key]) + }) + return expanded } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6WyJhcHBseVBhdGNoIiwic291cmNlIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJwYXJzZVBhdGNoIiwiQXJyYXkiLCJpc0FycmF5IiwibGVuZ3RoIiwiRXJyb3IiLCJsaW5lcyIsInNwbGl0IiwiZGVsaW1pdGVycyIsIm1hdGNoIiwiaHVua3MiLCJjb21wYXJlTGluZSIsImxpbmVOdW1iZXIiLCJsaW5lIiwib3BlcmF0aW9uIiwicGF0Y2hDb250ZW50IiwiZXJyb3JDb3VudCIsImZ1enpGYWN0b3IiLCJtaW5MaW5lIiwib2Zmc2V0IiwicmVtb3ZlRU9GTkwiLCJhZGRFT0ZOTCIsImh1bmtGaXRzIiwiaHVuayIsInRvUG9zIiwiaiIsImNvbnRlbnQi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gdW5pRGlmZiA9PT0gJ3N0cmluZycpIHtcbiAgICB1bmlEaWZmID0gcGFyc2VQYXRjaCh1bmlEaWZmKTtcbiAgfVxuXG4gIGxldCBjdXJyZW50SW5kZXggPSAwO1xuICBmdW5jdGlvbiBwcm9jZXNzSW5kZXgoKSB7XG4gICAgbGV0IGluZGV4ID0gdW5pRGlmZltjdXJyZW50SW5kZXgrK107XG4gICAgaWYgKCFpbmRleCkge1xuICAgICAgcmV0dXJuIG9wdGlvbnMuY29tcGxldGUoKTtcbiAgICB9XG5cbiAgICBvcHRpb25zLmxvYWRGaWxlKGluZGV4LCBmdW5jdGlvbihlcnIsIGRhdGEpIHtcbiAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgcmV0dXJuIG9wdGlvbnMuY29tcGxldGUoZXJyKTtcbiAgICAgIH1cblxuICAgICAgbGV0IHVwZGF0ZWRDb250ZW50ID0gYXBwbHlQYXRjaChkYXRhLCBpbmRleCwgb3B0aW9ucyk7XG4gICAgICBvcHRpb25zLnBhdGNoZWQoaW5kZXgsIHVwZGF0ZWRDb250ZW50LCBmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgaWYgKGVycikge1xuICAgICAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKGVycik7XG4gICAgICAgIH1cblxuICAgICAgICBwcm9jZXNzSW5kZXgoKTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG4gIHByb2Nlc3NJbmRleCgpO1xufVxuIl19 /***/ }), -/***/ 64543: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 86207: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -/*istanbul ignore start*/ -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.structuredPatch = structuredPatch; -exports.formatPatch = formatPatch; -exports.createTwoFilesPatch = createTwoFilesPatch; -exports.createPatch = createPatch; +const dateFormat = __nccwpck_require__(51512) +const join = __nccwpck_require__(85622).join +const readFileSync = __nccwpck_require__(35747).readFileSync +const semverValid = __nccwpck_require__(85911).valid +const through = __nccwpck_require__(18180) +const util = __nccwpck_require__(78857) +const _ = __nccwpck_require__(90250) -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_line = __nccwpck_require__(41591) -/*istanbul ignore end*/ -; - -/*istanbul ignore start*/ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function conventionalChangelogWriterInit (context, options) { + context = _.extend({ + commit: 'commits', + issue: 'issues', + date: dateFormat(new Date(), 'yyyy-mm-dd', true) + }, context) -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + if (!_.isBoolean(context.linkReferences) && (context.repository || context.repoUrl) && context.commit && context.issue) { + context.linkReferences = true + } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + options = _.assign({ + groupBy: 'type', + commitsSort: 'header', + noteGroupsSort: 'title', + notesSort: 'text', + generateOn: function (commit) { + return semverValid(commit.version) + }, + finalizeContext: function (context) { + return context + }, + debug: function () {}, + reverse: false, + includeDetails: false, + ignoreReverted: true, + doFlush: true, + mainTemplate: readFileSync(__nccwpck_require__.ab + "template1.hbs", 'utf-8'), + headerPartial: readFileSync(__nccwpck_require__.ab + "header1.hbs", 'utf-8'), + commitPartial: readFileSync(__nccwpck_require__.ab + "commit1.hbs", 'utf-8'), + footerPartial: readFileSync(__nccwpck_require__.ab + "footer.hbs", 'utf-8') + }, options) -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + if ((!_.isFunction(options.transform) && _.isObject(options.transform)) || _.isUndefined(options.transform)) { + options.transform = _.assign({ + hash: function (hash) { + if (_.isString(hash)) { + return hash.substring(0, 7) + } + }, + header: function (header) { + return header.substring(0, 100) + }, + committerDate: function (date) { + if (!date) { + return + } -/*istanbul ignore end*/ -function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (!options) { - options = {}; + return dateFormat(date, 'yyyy-mm-dd', true) + } + }, options.transform) } - if (typeof options.context === 'undefined') { - options.context = 4; + let generateOn = options.generateOn + if (_.isString(generateOn)) { + generateOn = function (commit) { + return !_.isUndefined(commit[options.generateOn]) + } + } else if (!_.isFunction(generateOn)) { + generateOn = function () { + return false + } } - var diff = - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ - - /*istanbul ignore start*/ - _line - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - diffLines) - /*istanbul ignore end*/ - (oldStr, newStr, options); - diff.push({ - value: '', - lines: [] - }); // Append an empty value to make cleanup easier - - function contextLines(lines) { - return lines.map(function (entry) { - return ' ' + entry; - }); - } + options.commitGroupsSort = util.functionify(options.commitGroupsSort) + options.commitsSort = util.functionify(options.commitsSort) + options.noteGroupsSort = util.functionify(options.noteGroupsSort) + options.notesSort = util.functionify(options.notesSort) - var hunks = []; - var oldRangeStart = 0, - newRangeStart = 0, - curRange = [], - oldLine = 1, - newLine = 1; + return { context, options, generateOn } +} - /*istanbul ignore start*/ - var _loop = function _loop( - /*istanbul ignore end*/ - i) { - var current = diff[i], - lines = current.lines || current.value.replace(/\n$/, '').split('\n'); - current.lines = lines; +function conventionalChangelogWriterParseStream (context, options) { + let generateOn + ({ context, options, generateOn } = conventionalChangelogWriterInit(context, options)) + let commits = [] + let neverGenerated = true + let savedKeyCommit + let firstRelease = true + return through.obj(function (chunk, _enc, cb) { + try { + let result + const commit = util.processCommit(chunk, options.transform, context) + const keyCommit = commit || chunk - if (current.added || current.removed) { - /*istanbul ignore start*/ - var _curRange; + // previous blocks of logs + if (options.reverse) { + if (commit) { + commits.push(commit) + } - /*istanbul ignore end*/ - // If we have previous context, start with that - if (!oldRangeStart) { - var prev = diff[i - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; + if (generateOn(keyCommit, commits, context, options)) { + neverGenerated = false + result = util.generate(options, commits, context, keyCommit) + if (options.includeDetails) { + this.push({ + log: result, + keyCommit: keyCommit + }) + } else { + this.push(result) + } - if (prev) { - curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; + commits = [] } - } // Output our changes + } else { + if (generateOn(keyCommit, commits, context, options)) { + neverGenerated = false + result = util.generate(options, commits, context, savedKeyCommit) + if (!firstRelease || options.doFlush) { + if (options.includeDetails) { + this.push({ + log: result, + keyCommit: savedKeyCommit + }) + } else { + this.push(result) + } + } - /*istanbul ignore start*/ + firstRelease = false + commits = [] + savedKeyCommit = keyCommit + } - /*istanbul ignore end*/ + if (commit) { + commits.push(commit) + } + } - /*istanbul ignore start*/ - (_curRange = - /*istanbul ignore end*/ - curRange).push.apply( - /*istanbul ignore start*/ - _curRange - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - lines.map(function (entry) { - return (current.added ? '+' : '-') + entry; - }))); // Track the updated file position + cb() + } catch (err) { + cb(err) + } + }, function (cb) { + if (!options.doFlush && (options.reverse || neverGenerated)) { + cb(null) + return + } + try { + const result = util.generate(options, commits, context, savedKeyCommit) - if (current.added) { - newLine += lines.length; + if (options.includeDetails) { + this.push({ + log: result, + keyCommit: savedKeyCommit + }) } else { - oldLine += lines.length; + this.push(result) } - } else { - // Identical context lines. Track line changes - if (oldRangeStart) { - // Close out any changes that have been output (or join overlapping) - if (lines.length <= options.context * 2 && i < diff.length - 2) { - /*istanbul ignore start*/ - var _curRange2; - - /*istanbul ignore end*/ - // Overlapping - /*istanbul ignore start*/ + cb() + } catch (err) { + cb(err) + } + }) +} - /*istanbul ignore end*/ +/* + * Given an array of commits, returns a string representing a CHANGELOG entry. + */ +conventionalChangelogWriterParseStream.parseArray = (rawCommits, context, options) => { + let generateOn + rawCommits = [...rawCommits]; + ({ context, options, generateOn } = conventionalChangelogWriterInit(context, options)) + let commits = [] + let savedKeyCommit + if (options.reverse) { + rawCommits.reverse() + } + const entries = [] + for (const rawCommit of rawCommits) { + const commit = util.processCommit(rawCommit, options.transform, context) + const keyCommit = commit || rawCommit + if (generateOn(keyCommit, commits, context, options)) { + entries.push(util.generate(options, commits, context, savedKeyCommit)) + savedKeyCommit = keyCommit + commits = [] + } + if (commit) { + commits.push(commit) + } + } + if (options.reverse) { + entries.reverse() + return util.generate(options, commits, context, savedKeyCommit) + entries.join('') + } else { + return entries.join('') + util.generate(options, commits, context, savedKeyCommit) + } +} - /*istanbul ignore start*/ - (_curRange2 = - /*istanbul ignore end*/ - curRange).push.apply( - /*istanbul ignore start*/ - _curRange2 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - contextLines(lines))); - } else { - /*istanbul ignore start*/ - var _curRange3; +module.exports = conventionalChangelogWriterParseStream - /*istanbul ignore end*/ - // end the range and output - var contextSize = Math.min(lines.length, options.context); - /*istanbul ignore start*/ +/***/ }), - /*istanbul ignore end*/ +/***/ 78857: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /*istanbul ignore start*/ - (_curRange3 = - /*istanbul ignore end*/ - curRange).push.apply( - /*istanbul ignore start*/ - _curRange3 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - contextLines(lines.slice(0, contextSize)))); +"use strict"; - var hunk = { - oldStart: oldRangeStart, - oldLines: oldLine - oldRangeStart + contextSize, - newStart: newRangeStart, - newLines: newLine - newRangeStart + contextSize, - lines: curRange - }; +const conventionalCommitsFilter = __nccwpck_require__(55003) +const Handlebars = __nccwpck_require__(97492) +const semver = __nccwpck_require__(85911) +const _ = __nccwpck_require__(90250) +const stringify = __nccwpck_require__(57073) - if (i >= diff.length - 2 && lines.length <= options.context) { - // EOF is inside this hunk - var oldEOFNewline = /\n$/.test(oldStr); - var newEOFNewline = /\n$/.test(newStr); - var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; +function compileTemplates (templates) { + const main = templates.mainTemplate + const headerPartial = templates.headerPartial + const commitPartial = templates.commitPartial + const footerPartial = templates.footerPartial + const partials = templates.partials - if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) { - // special case: old has no eol and no trailing context; no-nl can end up before adds - // however, if the old file is empty, do not output the no-nl line - curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); - } + if (_.isString(headerPartial)) { + Handlebars.registerPartial('header', headerPartial) + } - if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { - curRange.push('\\ No newline at end of file'); - } - } + if (_.isString(commitPartial)) { + Handlebars.registerPartial('commit', commitPartial) + } - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } + if (_.isString(footerPartial)) { + Handlebars.registerPartial('footer', footerPartial) + } - oldLine += lines.length; - newLine += lines.length; + _.forEach(partials, function (partial, name) { + if (_.isString(partial)) { + Handlebars.registerPartial(name, partial) } - }; - - for (var i = 0; i < diff.length; i++) { - /*istanbul ignore start*/ - _loop( - /*istanbul ignore end*/ - i); - } + }) - return { - oldFileName: oldFileName, - newFileName: newFileName, - oldHeader: oldHeader, - newHeader: newHeader, - hunks: hunks - }; + return Handlebars.compile(main, { + noEscape: true + }) } -function formatPatch(diff) { - var ret = []; - - if (diff.oldFileName == diff.newFileName) { - ret.push('Index: ' + diff.oldFileName); +function functionify (strOrArr) { + if (strOrArr && !_.isFunction(strOrArr)) { + return (a, b) => { + let str1 = '' + let str2 = '' + if (Array.isArray(strOrArr)) { + for (const key of strOrArr) { + str1 += a[key] || '' + str2 += b[key] || '' + } + } else { + str1 += a[strOrArr] + str2 += b[strOrArr] + } + return str1.localeCompare(str2) + } + } else { + return strOrArr } +} - ret.push('==================================================================='); - ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); - ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); - - for (var i = 0; i < diff.hunks.length; i++) { - var hunk = diff.hunks[i]; // Unified Diff Format quirk: If the chunk size is 0, - // the first number is one lower than one would expect. - // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 +function getCommitGroups (groupBy, commits, groupsSort, commitsSort) { + const commitGroups = [] + const commitGroupsObj = _.groupBy(commits, function (commit) { + return commit[groupBy] || '' + }) - if (hunk.oldLines === 0) { - hunk.oldStart -= 1; + _.forEach(commitGroupsObj, function (commits, title) { + if (title === '') { + title = false } - if (hunk.newLines === 0) { - hunk.newStart -= 1; + if (commitsSort) { + commits.sort(commitsSort) } - ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); - ret.push.apply(ret, hunk.lines); + commitGroups.push({ + title: title, + commits: commits + }) + }) + + if (groupsSort) { + commitGroups.sort(groupsSort) } - return ret.join('\n') + '\n'; + return commitGroups } -function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)); -} +function getNoteGroups (notes, noteGroupsSort, notesSort) { + const retGroups = [] -function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjoz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2sgbGluZSBjaGFuZ2VzXG4gICAgICBpZiAob2xkUmFuZ2VTdGFydCkge1xuICAgICAgICAvLyBDbG9zZSBvdXQgYW55IGNoYW5nZXMgdGhhdCBoYXZlIGJlZW4gb3V0cHV0IChvciBqb2luIG92ZXJsYXBwaW5nKVxuICAgICAgICBpZiAobGluZXMubGVuZ3RoIDw9IG9wdGlvbnMuY29udGV4dCAqIDIgJiYgaSA8IGRpZmYubGVuZ3RoIC0gMikge1xuICAgICAgICAgIC8vIE92ZXJsYXBwaW5nXG4gICAgICAgICAgY3VyUmFuZ2UucHVzaCguLi4gY29udGV4dExpbmVzKGxpbmVzKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gZW5kIHRoZSByYW5nZSBhbmQgb3V0cHV0XG4gICAgICAgICAgbGV0IGNvbnRleHRTaXplID0gTWF0aC5taW4obGluZXMubGVuZ3RoLCBvcHRpb25zLmNvbnRleHQpO1xuICAgICAgICAgIGN1clJhbmdlLnB1c2goLi4uIGNvbnRleHRMaW5lcyhsaW5lcy5zbGljZSgwLCBjb250ZXh0U2l6ZSkpKTtcblxuICAgICAgICAgIGxldCBodW5rID0ge1xuICAgICAgICAgICAgb2xkU3RhcnQ6IG9sZFJhbmdlU3RhcnQsXG4gICAgICAgICAgICBvbGRMaW5lczogKG9sZExpbmUgLSBvbGRSYW5nZVN0YXJ0ICsgY29udGV4dFNpemUpLFxuICAgICAgICAgICAgbmV3U3RhcnQ6IG5ld1JhbmdlU3RhcnQsXG4gICAgICAgICAgICBuZXdMaW5lczogKG5ld0xpbmUgLSBuZXdSYW5nZVN0YXJ0ICsgY29udGV4dFNpemUpLFxuICAgICAgICAgICAgbGluZXM6IGN1clJhbmdlXG4gICAgICAgICAgfTtcbiAgICAgICAgICBpZiAoaSA+PSBkaWZmLmxlbmd0aCAtIDIgJiYgbGluZXMubGVuZ3RoIDw9IG9wdGlvbnMuY29udGV4dCkge1xuICAgICAgICAgICAgLy8gRU9GIGlzIGluc2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b2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpIHtcbiAgcmV0dXJuIGNyZWF0ZVR3b0ZpbGVzUGF0Y2goZmlsZU5hbWUsIGZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpO1xufVxuIl19 + _.forEach(notes, function (note) { + const title = note.title + let titleExists = false + _.forEach(retGroups, function (group) { + if (group.title === title) { + titleExists = true + group.notes.push(note) + return false + } + }) -/***/ }), + if (!titleExists) { + retGroups.push({ + title: title, + notes: [note] + }) + } + }) -/***/ 22640: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (noteGroupsSort) { + retGroups.sort(noteGroupsSort) + } -"use strict"; -/*istanbul ignore start*/ + if (notesSort) { + _.forEach(retGroups, function (group) { + group.notes.sort(notesSort) + }) + } + return retGroups +} -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.calcLineCount = calcLineCount; -exports.merge = merge; +function processCommit (chunk, transform, context) { + let commit -/*istanbul ignore end*/ -var -/*istanbul ignore start*/ -_create = __nccwpck_require__(64543) -/*istanbul ignore end*/ -; + try { + chunk = JSON.parse(chunk) + } catch (e) {} -var -/*istanbul ignore start*/ -_parse = __nccwpck_require__(15870) -/*istanbul ignore end*/ -; + commit = _.cloneDeep(chunk) -var -/*istanbul ignore start*/ -_array = __nccwpck_require__(78935) -/*istanbul ignore end*/ -; + if (_.isFunction(transform)) { + commit = transform(commit, context) -/*istanbul ignore start*/ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + if (commit) { + commit.raw = chunk + } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + return commit + } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + _.forEach(transform, function (el, path) { + let value = _.get(commit, path) -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + if (_.isFunction(el)) { + value = el(value, path) + } else { + value = el + } -/*istanbul ignore end*/ -function calcLineCount(hunk) { - /*istanbul ignore start*/ - var _calcOldNewLineCount = - /*istanbul ignore end*/ - calcOldNewLineCount(hunk.lines), - oldLines = _calcOldNewLineCount.oldLines, - newLines = _calcOldNewLineCount.newLines; + _.set(commit, path, value) + }) - if (oldLines !== undefined) { - hunk.oldLines = oldLines; - } else { - delete hunk.oldLines; - } + commit.raw = chunk - if (newLines !== undefined) { - hunk.newLines = newLines; - } else { - delete hunk.newLines; - } + return commit } -function merge(mine, theirs, base) { - mine = loadPatch(mine, base); - theirs = loadPatch(theirs, base); - var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning. - // Leaving sanity checks on this to the API consumer that may know more about the - // meaning in their own context. +function getExtraContext (commits, notes, options) { + const context = {} - if (mine.index || theirs.index) { - ret.index = mine.index || theirs.index; - } + // group `commits` by `options.groupBy` + context.commitGroups = getCommitGroups(options.groupBy, commits, options.commitGroupsSort, options.commitsSort) - if (mine.newFileName || theirs.newFileName) { - if (!fileNameChanged(mine)) { - // No header or no change in ours, use theirs (and ours if theirs does not exist) - ret.oldFileName = theirs.oldFileName || mine.oldFileName; - ret.newFileName = theirs.newFileName || mine.newFileName; - ret.oldHeader = theirs.oldHeader || mine.oldHeader; - ret.newHeader = theirs.newHeader || mine.newHeader; - } else if (!fileNameChanged(theirs)) { - // No header or no change in theirs, use ours - ret.oldFileName = mine.oldFileName; - ret.newFileName = mine.newFileName; - ret.oldHeader = mine.oldHeader; - ret.newHeader = mine.newHeader; - } else { - // Both changed... figure it out - ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); - ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); - ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); - ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); - } - } + // group `notes` for footer + context.noteGroups = getNoteGroups(notes, options.noteGroupsSort, options.notesSort) - ret.hunks = []; - var mineIndex = 0, - theirsIndex = 0, - mineOffset = 0, - theirsOffset = 0; + return context +} - while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { - var mineCurrent = mine.hunks[mineIndex] || { - oldStart: Infinity - }, - theirsCurrent = theirs.hunks[theirsIndex] || { - oldStart: Infinity - }; +function generate (options, commits, context, keyCommit) { + let notes = [] + let filteredCommits + const compiled = compileTemplates(options) - if (hunkBefore(mineCurrent, theirsCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); - mineIndex++; - theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; - } else if (hunkBefore(theirsCurrent, mineCurrent)) { - // This patch does not overlap with any of the others, yay. - ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); - theirsIndex++; - mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; - } else { - // Overlap, merge as best we can - var mergedHunk = { - oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), - oldLines: 0, - newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), - newLines: 0, - lines: [] - }; - mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); - theirsIndex++; - mineIndex++; - ret.hunks.push(mergedHunk); - } + if (options.ignoreReverted) { + filteredCommits = conventionalCommitsFilter(commits) + } else { + filteredCommits = _.clone(commits) } - return ret; -} - -function loadPatch(param, base) { - if (typeof param === 'string') { - if (/^@@/m.test(param) || /^Index:/m.test(param)) { - return ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ + _.forEach(filteredCommits, function (commit) { + _.map(commit.notes, function (note) { + note.commit = commit - /*istanbul ignore start*/ - _parse - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - parsePatch) - /*istanbul ignore end*/ - (param)[0] - ); - } + return note + }) - if (!base) { - throw new Error('Must provide a base reference or pass in a patch'); - } + notes = notes.concat(commit.notes) + }) - return ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ + context = _.merge({}, context, keyCommit, getExtraContext(filteredCommits, notes, options)) - /*istanbul ignore start*/ - _create - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - structuredPatch) - /*istanbul ignore end*/ - (undefined, undefined, base, param) - ); + if (keyCommit && keyCommit.committerDate) { + context.date = keyCommit.committerDate } - return param; -} - -function fileNameChanged(patch) { - return patch.newFileName && patch.newFileName !== patch.oldFileName; -} - -function selectField(index, mine, theirs) { - if (mine === theirs) { - return mine; - } else { - index.conflict = true; - return { - mine: mine, - theirs: theirs - }; + if (context.version && semver.valid(context.version)) { + context.isPatch = context.isPatch || semver.patch(context.version) !== 0 } -} -function hunkBefore(test, check) { - return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; -} + context = options.finalizeContext(context, options, filteredCommits, keyCommit, commits) + options.debug('Your final context is:\n' + stringify(context, null, 2)) -function cloneHunk(hunk, offset) { - return { - oldStart: hunk.oldStart, - oldLines: hunk.oldLines, - newStart: hunk.newStart + offset, - newLines: hunk.newLines, - lines: hunk.lines - }; + return compiled(context) } -function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { - // This will generally result in a conflicted hunk, but there are cases where the context - // is the only overlap where we can successfully merge the content here. - var mine = { - offset: mineOffset, - lines: mineLines, - index: 0 - }, - their = { - offset: theirOffset, - lines: theirLines, - index: 0 - }; // Handle any leading content - - insertLeading(hunk, mine, their); - insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each. +module.exports = { + compileTemplates: compileTemplates, + functionify: functionify, + getCommitGroups: getCommitGroups, + getNoteGroups: getNoteGroups, + processCommit: processCommit, + getExtraContext: getExtraContext, + generate: generate +} - while (mine.index < mine.lines.length && their.index < their.lines.length) { - var mineCurrent = mine.lines[mine.index], - theirCurrent = their.lines[their.index]; - if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { - // Both modified ... - mutualChange(hunk, mine, their); - } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { - /*istanbul ignore start*/ - var _hunk$lines; +/***/ }), - /*istanbul ignore end*/ - // Mine inserted +/***/ 55003: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - /*istanbul ignore start*/ +"use strict"; - /*istanbul ignore end*/ - /*istanbul ignore start*/ - (_hunk$lines = - /*istanbul ignore end*/ - hunk.lines).push.apply( - /*istanbul ignore start*/ - _hunk$lines - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - collectChange(mine))); - } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { - /*istanbul ignore start*/ - var _hunk$lines2; +const isMatch = __nccwpck_require__(15100) +const modifyValues = __nccwpck_require__(23432) - /*istanbul ignore end*/ - // Theirs inserted +function modifyValue (val) { + if (typeof val === 'string') { + return val.trim() + } - /*istanbul ignore start*/ + return val +} - /*istanbul ignore end*/ +function conventionalCommitsFilter (commits) { + if (!Array.isArray(commits)) { + throw new TypeError('Expected an array') + } - /*istanbul ignore start*/ - (_hunk$lines2 = - /*istanbul ignore end*/ - hunk.lines).push.apply( - /*istanbul ignore start*/ - _hunk$lines2 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - collectChange(their))); - } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { - // Mine removed or edited - removal(hunk, mine, their); - } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { - // Their removed or edited - removal(hunk, their, mine, true); - } else if (mineCurrent === theirCurrent) { - // Context identity - hunk.lines.push(mineCurrent); - mine.index++; - their.index++; - } else { - // Context mismatch - conflict(hunk, collectChange(mine), collectChange(their)); + let ret = [] + const ignores = [] + const remove = [] + commits.forEach(function (commit) { + if (commit.revert) { + ignores.push(commit) } - } // Now push anything that may be remaining + ret.push(commit) + }) - insertTrailing(hunk, mine); - insertTrailing(hunk, their); - calcLineCount(hunk); -} + // Filter out reverted commits + ret = ret.filter(function (commit) { + let ignoreThis = false -function mutualChange(hunk, mine, their) { - var myChanges = collectChange(mine), - theirChanges = collectChange(their); + commit = commit.raw ? modifyValues(commit.raw, modifyValue) : modifyValues(commit, modifyValue) - if (allRemoves(myChanges) && allRemoves(theirChanges)) { - // Special case for remove changes that are supersets of one another - if ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ + ignores.some(function (ignoreCommit) { + const ignore = modifyValues(ignoreCommit.revert, modifyValue) - /*istanbul ignore start*/ - _array - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - arrayStartsWith) - /*istanbul ignore end*/ - (myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { - /*istanbul ignore start*/ - var _hunk$lines3; + ignoreThis = isMatch(commit, ignore) - /*istanbul ignore end*/ + if (ignoreThis) { + remove.push(ignoreCommit.hash) + } - /*istanbul ignore start*/ + return ignoreThis + }) - /*istanbul ignore end*/ + return !ignoreThis + }) - /*istanbul ignore start*/ - (_hunk$lines3 = - /*istanbul ignore end*/ - hunk.lines).push.apply( - /*istanbul ignore start*/ - _hunk$lines3 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - myChanges)); + // Filter out the commits that reverted something otherwise keep the revert commits + ret = ret.filter(function (commit) { + return remove.indexOf(commit.hash) !== 0 + }) - return; - } else if ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ + return ret +} - /*istanbul ignore start*/ - _array - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - arrayStartsWith) - /*istanbul ignore end*/ - (theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { - /*istanbul ignore start*/ - var _hunk$lines4; +module.exports = conventionalCommitsFilter - /*istanbul ignore end*/ - /*istanbul ignore start*/ +/***/ }), - /*istanbul ignore end*/ +/***/ 95898: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /*istanbul ignore start*/ - (_hunk$lines4 = - /*istanbul ignore end*/ - hunk.lines).push.apply( - /*istanbul ignore start*/ - _hunk$lines4 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - theirChanges)); +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - return; - } - } else if ( - /*istanbul ignore start*/ - (0, - /*istanbul ignore end*/ +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. - /*istanbul ignore start*/ - _array - /*istanbul ignore end*/ - . - /*istanbul ignore start*/ - arrayEqual) - /*istanbul ignore end*/ - (myChanges, theirChanges)) { - /*istanbul ignore start*/ - var _hunk$lines5; +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; - /*istanbul ignore end*/ +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; - /*istanbul ignore start*/ +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; - /*istanbul ignore end*/ +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; - /*istanbul ignore start*/ - (_hunk$lines5 = - /*istanbul ignore end*/ - hunk.lines).push.apply( - /*istanbul ignore start*/ - _hunk$lines5 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - myChanges)); +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; - return; - } +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; - conflict(hunk, myChanges, theirChanges); +function isSymbol(arg) { + return typeof arg === 'symbol'; } +exports.isSymbol = isSymbol; -function removal(hunk, mine, their, swap) { - var myChanges = collectChange(mine), - theirChanges = collectContext(their, myChanges); +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; - if (theirChanges.merged) { - /*istanbul ignore start*/ - var _hunk$lines6; +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; - /*istanbul ignore end*/ +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; - /*istanbul ignore start*/ +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; - /*istanbul ignore end*/ +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; - /*istanbul ignore start*/ - (_hunk$lines6 = - /*istanbul ignore end*/ - hunk.lines).push.apply( - /*istanbul ignore start*/ - _hunk$lines6 - /*istanbul ignore end*/ - , - /*istanbul ignore start*/ - _toConsumableArray( - /*istanbul ignore end*/ - theirChanges.merged)); - } else { - conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); - } +function isFunction(arg) { + return typeof arg === 'function'; } +exports.isFunction = isFunction; -function conflict(hunk, mine, their) { - hunk.conflict = true; - hunk.lines.push({ - conflict: true, - mine: mine, - theirs: their - }); +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; } +exports.isPrimitive = isPrimitive; -function insertLeading(hunk, insert, their) { - while (insert.offset < their.offset && insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - insert.offset++; - } -} +exports.isBuffer = __nccwpck_require__(64293).Buffer.isBuffer; -function insertTrailing(hunk, insert) { - while (insert.index < insert.lines.length) { - var line = insert.lines[insert.index++]; - hunk.lines.push(line); - } +function objectToString(o) { + return Object.prototype.toString.call(o); } -function collectChange(state) { - var ret = [], - operation = state.lines[state.index][0]; - while (state.index < state.lines.length) { - var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. +/***/ }), - if (operation === '-' && line[0] === '+') { - operation = '+'; - } +/***/ 36863: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - if (operation === line[0]) { - ret.push(line); - state.index++; - } else { - break; - } - } +"use strict"; - return ret; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.attributeRules = void 0; +var boolbase_1 = __nccwpck_require__(44159); +/** + * All reserved characters in a regex, used for escaping. + * + * Taken from XRegExp, (c) 2007-2020 Steven Levithan under the MIT license + * https://github.com/slevithan/xregexp/blob/95eeebeb8fac8754d54eafe2b4743661ac1cf028/src/xregexp.js#L794 + */ +var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g; +function escapeRegex(value) { + return value.replace(reChars, "\\$&"); } +/** + * Attribute selectors + */ +exports.attributeRules = { + equals: function (next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + if (data.ignoreCase) { + value = value.toLowerCase(); + return function (elem) { + var attr = adapter.getAttributeValue(elem, name); + return (attr != null && + attr.length === value.length && + attr.toLowerCase() === value && + next(elem)); + }; + } + return function (elem) { + return adapter.getAttributeValue(elem, name) === value && next(elem); + }; + }, + hyphen: function (next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + var len = value.length; + if (data.ignoreCase) { + value = value.toLowerCase(); + return function hyphenIC(elem) { + var attr = adapter.getAttributeValue(elem, name); + return (attr != null && + (attr.length === len || attr.charAt(len) === "-") && + attr.substr(0, len).toLowerCase() === value && + next(elem)); + }; + } + return function hyphen(elem) { + var attr = adapter.getAttributeValue(elem, name); + return (attr != null && + (attr.length === len || attr.charAt(len) === "-") && + attr.substr(0, len) === value && + next(elem)); + }; + }, + element: function (next, _a, _b) { + var name = _a.name, value = _a.value, ignoreCase = _a.ignoreCase; + var adapter = _b.adapter; + if (/\s/.test(value)) { + return boolbase_1.falseFunc; + } + var regex = new RegExp("(?:^|\\s)".concat(escapeRegex(value), "(?:$|\\s)"), ignoreCase ? "i" : ""); + return function element(elem) { + var attr = adapter.getAttributeValue(elem, name); + return (attr != null && + attr.length >= value.length && + regex.test(attr) && + next(elem)); + }; + }, + exists: function (next, _a, _b) { + var name = _a.name; + var adapter = _b.adapter; + return function (elem) { return adapter.hasAttrib(elem, name) && next(elem); }; + }, + start: function (next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + var len = value.length; + if (len === 0) { + return boolbase_1.falseFunc; + } + if (data.ignoreCase) { + value = value.toLowerCase(); + return function (elem) { + var attr = adapter.getAttributeValue(elem, name); + return (attr != null && + attr.length >= len && + attr.substr(0, len).toLowerCase() === value && + next(elem)); + }; + } + return function (elem) { + var _a; + return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.startsWith(value)) && + next(elem); + }; + }, + end: function (next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + var len = -value.length; + if (len === 0) { + return boolbase_1.falseFunc; + } + if (data.ignoreCase) { + value = value.toLowerCase(); + return function (elem) { + var _a; + return ((_a = adapter + .getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.substr(len).toLowerCase()) === value && next(elem); + }; + } + return function (elem) { + var _a; + return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.endsWith(value)) && + next(elem); + }; + }, + any: function (next, data, _a) { + var adapter = _a.adapter; + var name = data.name, value = data.value; + if (value === "") { + return boolbase_1.falseFunc; + } + if (data.ignoreCase) { + var regex_1 = new RegExp(escapeRegex(value), "i"); + return function anyIC(elem) { + var attr = adapter.getAttributeValue(elem, name); + return (attr != null && + attr.length >= value.length && + regex_1.test(attr) && + next(elem)); + }; + } + return function (elem) { + var _a; + return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.includes(value)) && + next(elem); + }; + }, + not: function (next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + if (value === "") { + return function (elem) { + return !!adapter.getAttributeValue(elem, name) && next(elem); + }; + } + else if (data.ignoreCase) { + value = value.toLowerCase(); + return function (elem) { + var attr = adapter.getAttributeValue(elem, name); + return ((attr == null || + attr.length !== value.length || + attr.toLowerCase() !== value) && + next(elem)); + }; + } + return function (elem) { + return adapter.getAttributeValue(elem, name) !== value && next(elem); + }; + }, +}; -function collectContext(state, matchChanges) { - var changes = [], - merged = [], - matchIndex = 0, - contextChanges = false, - conflicted = false; - - while (matchIndex < matchChanges.length && state.index < state.lines.length) { - var change = state.lines[state.index], - match = matchChanges[matchIndex]; // Once we've hit our add, then we are done - - if (match[0] === '+') { - break; - } - - contextChanges = contextChanges || change[0] !== ' '; - merged.push(match); - matchIndex++; // Consume any additions in the other block as a conflict to attempt - // to pull in the remaining context after this - - if (change[0] === '+') { - conflicted = true; - - while (change[0] === '+') { - changes.push(change); - change = state.lines[++state.index]; - } - } - - if (match.substr(1) === change.substr(1)) { - changes.push(change); - state.index++; - } else { - conflicted = true; - } - } - if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { - conflicted = true; - } +/***/ }), - if (conflicted) { - return changes; - } +/***/ 35030: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - while (matchIndex < matchChanges.length) { - merged.push(matchChanges[matchIndex++]); - } +"use strict"; - return { - merged: merged, - changes: changes - }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.compileToken = exports.compileUnsafe = exports.compile = void 0; +var css_what_1 = __nccwpck_require__(19218); +var boolbase_1 = __nccwpck_require__(44159); +var sort_1 = __importDefault(__nccwpck_require__(57320)); +var procedure_1 = __nccwpck_require__(47396); +var general_1 = __nccwpck_require__(45374); +var subselects_1 = __nccwpck_require__(15813); +/** + * Compiles a selector to an executable function. + * + * @param selector Selector to compile. + * @param options Compilation options. + * @param context Optional context for the selector. + */ +function compile(selector, options, context) { + var next = compileUnsafe(selector, options, context); + return (0, subselects_1.ensureIsTag)(next, options.adapter); } - -function allRemoves(changes) { - return changes.reduce(function (prev, change) { - return prev && change[0] === '-'; - }, true); +exports.compile = compile; +function compileUnsafe(selector, options, context) { + var token = typeof selector === "string" ? (0, css_what_1.parse)(selector, options) : selector; + return compileToken(token, options, context); } - -function skipRemoveSuperset(state, removeChanges, delta) { - for (var i = 0; i < delta; i++) { - var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); - - if (state.lines[state.index + i] !== ' ' + changeContent) { - return false; - } - } - - state.index += delta; - return true; +exports.compileUnsafe = compileUnsafe; +function includesScopePseudo(t) { + return (t.type === "pseudo" && + (t.name === "scope" || + (Array.isArray(t.data) && + t.data.some(function (data) { return data.some(includesScopePseudo); })))); } - -function calcOldNewLineCount(lines) { - var oldLines = 0; - var newLines = 0; - lines.forEach(function (line) { - if (typeof line !== 'string') { - var myCount = calcOldNewLineCount(line.mine); - var theirCount = calcOldNewLineCount(line.theirs); - - if (oldLines !== undefined) { - if (myCount.oldLines === theirCount.oldLines) { - oldLines += myCount.oldLines; - } else { - oldLines = undefined; +var DESCENDANT_TOKEN = { type: "descendant" }; +var FLEXIBLE_DESCENDANT_TOKEN = { + type: "_flexibleDescendant", +}; +var SCOPE_TOKEN = { type: "pseudo", name: "scope", data: null }; +/* + * CSS 4 Spec (Draft): 3.3.1. Absolutizing a Scope-relative Selector + * http://www.w3.org/TR/selectors4/#absolutizing + */ +function absolutize(token, _a, context) { + var adapter = _a.adapter; + // TODO Use better check if the context is a document + var hasContext = !!(context === null || context === void 0 ? void 0 : context.every(function (e) { + var parent = adapter.isTag(e) && adapter.getParent(e); + return e === subselects_1.PLACEHOLDER_ELEMENT || (parent && adapter.isTag(parent)); + })); + for (var _i = 0, token_1 = token; _i < token_1.length; _i++) { + var t = token_1[_i]; + if (t.length > 0 && (0, procedure_1.isTraversal)(t[0]) && t[0].type !== "descendant") { + // Don't continue in else branch } - } - - if (newLines !== undefined) { - if (myCount.newLines === theirCount.newLines) { - newLines += myCount.newLines; - } else { - newLines = undefined; + else if (hasContext && !t.some(includesScopePseudo)) { + t.unshift(DESCENDANT_TOKEN); } - } - } else { - if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { - newLines++; - } - - if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { - oldLines++; - } + else { + continue; + } + t.unshift(SCOPE_TOKEN); } - }); - return { - oldLines: oldLines, - newLines: newLines - }; } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9tZXJnZS5qc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pO1xuICAgIGlmIChzdGF0ZS5saW5lc1tzdGF0ZS5pbmRleCArIGldICE9PSAnICcgKyBjaGFuZ2VDb250ZW50KSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG5cbiAgc3RhdGUuaW5kZXggKz0gZGVsdGE7XG4gIHJldHVybiB0cnVlO1xufVxuXG5mdW5jdGlvbiBjYWxjT2xkTmV3TGluZUNvdW50KGxpbmVzKSB7XG4gIGxldCBvbGRMaW5lcyA9IDA7XG4gIGxldCBuZXdMaW5lcyA9IDA7XG5cbiAgbGluZXMuZm9yRWFjaChmdW5jdGlvbihsaW5lKSB7XG4gICAgaWYgKHR5cGVvZiBsaW5lICE9PSAnc3RyaW5nJykge1xuICAgICAgbGV0IG15Q291bnQgPSBjYWxjT2xkTmV3TGluZUNvdW50KGxpbmUubWluZSk7XG4gICAgICBsZXQgdGhlaXJDb3VudCA9IGNhbGNPbGROZXdMaW5lQ291bnQobGluZS50aGVpcnMpO1xuXG4gICAgICBpZiAob2xkTGluZXMgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAobXlDb3VudC5vbGRMaW5lcyA9PT0gdGhlaXJDb3VudC5vbGRMaW5lcykge1xuICAgICAgICAgIG9sZExpbmVzICs9IG15Q291bnQub2xkTGluZXM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgb2xkTGluZXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKG5ld0xpbmVzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKG15Q291bnQubmV3TGluZXMgPT09IHRoZWlyQ291bnQubmV3TGluZXMpIHtcbiAgICAgICAgICBuZXdMaW5lcyArPSBteUNvdW50Lm5ld0xpbmVzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5ld0xpbmVzID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmIChuZXdMaW5lcyAhPT0gdW5kZWZpbmVkICYmIChsaW5lWzBdID09PSAnKycgfHwgbGluZVswXSA9PT0gJyAnKSkge1xuICAgICAgICBuZXdMaW5lcysrO1xuICAgICAgfVxuICAgICAgaWYgKG9sZExpbmVzICE9PSB1bmRlZmluZWQgJiYgKGxpbmVbMF0gPT09ICctJyB8fCBsaW5lWzBdID09PSAnICcpKSB7XG4gICAgICAgIG9sZExpbmVzKys7XG4gICAgICB9XG4gICAgfVxuICB9KTtcblxuICByZXR1cm4ge29sZExpbmVzLCBuZXdMaW5lc307XG59XG4iXX0= +function compileToken(token, options, context) { + var _a; + token = token.filter(function (t) { return t.length > 0; }); + token.forEach(sort_1.default); + context = (_a = options.context) !== null && _a !== void 0 ? _a : context; + var isArrayContext = Array.isArray(context); + var finalContext = context && (Array.isArray(context) ? context : [context]); + absolutize(token, options, finalContext); + var shouldTestNextSiblings = false; + var query = token + .map(function (rules) { + if (rules.length >= 2) { + var first = rules[0], second = rules[1]; + if (first.type !== "pseudo" || first.name !== "scope") { + // Ignore + } + else if (isArrayContext && second.type === "descendant") { + rules[1] = FLEXIBLE_DESCENDANT_TOKEN; + } + else if (second.type === "adjacent" || + second.type === "sibling") { + shouldTestNextSiblings = true; + } + } + return compileRules(rules, options, finalContext); + }) + .reduce(reduceRules, boolbase_1.falseFunc); + query.shouldTestNextSiblings = shouldTestNextSiblings; + return query; +} +exports.compileToken = compileToken; +function compileRules(rules, options, context) { + var _a; + return rules.reduce(function (previous, rule) { + return previous === boolbase_1.falseFunc + ? boolbase_1.falseFunc + : (0, general_1.compileGeneralSelector)(previous, rule, options, context, compileToken); + }, (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase_1.trueFunc); +} +function reduceRules(a, b) { + if (b === boolbase_1.falseFunc || a === boolbase_1.trueFunc) { + return a; + } + if (a === boolbase_1.falseFunc || b === boolbase_1.trueFunc) { + return b; + } + return function combine(elem) { + return a(elem) || b(elem); + }; +} /***/ }), -/***/ 15870: -/***/ ((__unused_webpack_module, exports) => { +/***/ 45374: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -/*istanbul ignore start*/ - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.parsePatch = parsePatch; - -/*istanbul ignore end*/ -function parsePatch(uniDiff) { - /*istanbul ignore start*/ - var - /*istanbul ignore end*/ - options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), - delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], - list = [], - i = 0; - - function parseIndex() { - var index = {}; - list.push(index); // Parse diff metadata - - while (i < diffstr.length) { - var line = diffstr[i]; // File header found, end parsing diff metadata - - if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { - break; - } // Diff index - - - var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); - - if (header) { - index.index = header[1]; - } - - i++; - } // Parse file headers if they are defined. Unified diff requires them, but - // there's no technical issues to have an isolated hunk without file header - - - parseFileHeader(index); - parseFileHeader(index); // Parse hunks - - index.hunks = []; - - while (i < diffstr.length) { - var _line = diffstr[i]; - - if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { - break; - } else if (/^@@/.test(_line)) { - index.hunks.push(parseHunk()); - } else if (_line && options.strict) { - // Ignore unexpected content unless in strict mode - throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); - } else { - i++; - } - } - } // Parses the --- and +++ headers, if none are found, no lines - // are consumed. - - function parseFileHeader(index) { - var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); - - if (fileHeader) { - var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; - var data = fileHeader[2].split('\t', 2); - var fileName = data[0].replace(/\\\\/g, '\\'); - - if (/^".*"$/.test(fileName)) { - fileName = fileName.substr(1, fileName.length - 2); - } - - index[keyPrefix + 'FileName'] = fileName; - index[keyPrefix + 'Header'] = (data[1] || '').trim(); - i++; - } - } // Parses a hunk - // This assumes that we are at the start of a hunk. - - - function parseHunk() { - var chunkHeaderIndex = i, - chunkHeaderLine = diffstr[i++], - chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); - var hunk = { - oldStart: +chunkHeader[1], - oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2], - newStart: +chunkHeader[3], - newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4], - lines: [], - linedelimiters: [] - }; // Unified Diff Format quirk: If the chunk size is 0, - // the first number is one lower than one would expect. - // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 - - if (hunk.oldLines === 0) { - hunk.oldStart += 1; - } - - if (hunk.newLines === 0) { - hunk.newStart += 1; - } - - var addCount = 0, - removeCount = 0; - - for (; i < diffstr.length; i++) { - // Lines starting with '---' could be mistaken for the "remove line" operation - // But they could be the header for the next file. Therefore prune such cases out. - if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { - break; - } - - var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; - - if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { - hunk.lines.push(diffstr[i]); - hunk.linedelimiters.push(delimiters[i] || '\n'); - - if (operation === '+') { - addCount++; - } else if (operation === '-') { - removeCount++; - } else if (operation === ' ') { - addCount++; - removeCount++; - } - } else { - break; - } - } // Handle the empty block count case - - - if (!addCount && hunk.newLines === 1) { - hunk.newLines = 0; - } - - if (!removeCount && hunk.oldLines === 1) { - hunk.oldLines = 0; - } // Perform optional sanity checking - - - if (options.strict) { - if (addCount !== hunk.newLines) { - throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } - - if (removeCount !== hunk.oldLines) { - throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.compileGeneralSelector = void 0; +var attributes_1 = __nccwpck_require__(36863); +var pseudo_selectors_1 = __nccwpck_require__(89312); +/* + * All available rules + */ +function compileGeneralSelector(next, selector, options, context, compileToken) { + var adapter = options.adapter, equals = options.equals; + switch (selector.type) { + case "pseudo-element": + throw new Error("Pseudo-elements are not supported by css-select"); + case "attribute": + return attributes_1.attributeRules[selector.action](next, selector, options); + case "pseudo": + return (0, pseudo_selectors_1.compilePseudoSelector)(next, selector, options, context, compileToken); + // Tags + case "tag": + return function tag(elem) { + return adapter.getName(elem) === selector.name && next(elem); + }; + // Traversal + case "descendant": + if (options.cacheResults === false || + typeof WeakSet === "undefined") { + return function descendant(elem) { + var current = elem; + while ((current = adapter.getParent(current))) { + if (adapter.isTag(current) && next(current)) { + return true; + } + } + return false; + }; + } + // @ts-expect-error `ElementNode` is not extending object + // eslint-disable-next-line no-case-declarations + var isFalseCache_1 = new WeakSet(); + return function cachedDescendant(elem) { + var current = elem; + while ((current = adapter.getParent(current))) { + if (!isFalseCache_1.has(current)) { + if (adapter.isTag(current) && next(current)) { + return true; + } + isFalseCache_1.add(current); + } + } + return false; + }; + case "_flexibleDescendant": + // Include element itself, only used while querying an array + return function flexibleDescendant(elem) { + var current = elem; + do { + if (adapter.isTag(current) && next(current)) + return true; + } while ((current = adapter.getParent(current))); + return false; + }; + case "parent": + return function parent(elem) { + return adapter + .getChildren(elem) + .some(function (elem) { return adapter.isTag(elem) && next(elem); }); + }; + case "child": + return function child(elem) { + var parent = adapter.getParent(elem); + return parent != null && adapter.isTag(parent) && next(parent); + }; + case "sibling": + return function sibling(elem) { + var siblings = adapter.getSiblings(elem); + for (var i = 0; i < siblings.length; i++) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + break; + if (adapter.isTag(currentSibling) && next(currentSibling)) { + return true; + } + } + return false; + }; + case "adjacent": + return function adjacent(elem) { + var siblings = adapter.getSiblings(elem); + var lastElement; + for (var i = 0; i < siblings.length; i++) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + break; + if (adapter.isTag(currentSibling)) { + lastElement = currentSibling; + } + } + return !!lastElement && next(lastElement); + }; + case "universal": + return next; } - - return hunk; - } - - while (i < diffstr.length) { - parseIndex(); - } - - return list; } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9wYXJzZS5qcyJdLCJuYW1lcyI6WyJwYXJzZVBhdGNoIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJkaWZmc3RyIiwic3BsaXQiLCJkZWxpbWl0ZXJzIiwibWF0Y2giLCJsaXN0IiwiaSIsInBhcnNlSW5kZXgiLCJpbmRleCIsInB1c2giLCJsZW5ndGgiLCJsaW5lIiwidGVzdCIsImhlYWRlciIsImV4ZWMiLCJwYXJzZUZpbGVIZWFkZXIiLCJodW5rcyIsInBhcnNlSHVuayIsInN0cmljdCIsIkVycm9yIiwiSlNPTiIsInN0cmluZ2lmeSIsImZpbGVIZWFkZXIiLCJrZXlQcmVmaXgiLCJkYXRhIiwiZmlsZU5hbWUiLCJyZXBsYWNlIiwic3Vic3RyIiwidHJpbSIsImNodW5rSGVhZGVySW5kZXgiLCJjaHVua0hlYWRlckxpbmUiLCJjaHVua0hlYWRlciIsImh1bmsiLCJvbGRTdGFydCIsIm9sZExpbmVzIiwibmV3U3RhcnQiLCJuZXdMaW5lcyIsImxpbmVzIiwibGluZWRlbGltaXRlcnMiLCJhZGRDb3VudCIsInJlbW92ZUNvdW50IiwiaW5kZXhPZiIsIm9wZXJhdGlvbiJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQU8sU0FBU0EsVUFBVCxDQUFvQkMsT0FBcEIsRUFBMkM7QUFBQTtBQUFBO0FBQUE7QUFBZEMsRUFBQUEsT0FBYyx1RUFBSixFQUFJO0FBQ2hELE1BQUlDLE9BQU8s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GVhZGVySW5kZXggKyAxKSk7XG4gICAgICB9XG4gICAgICBpZiAocmVtb3ZlQ291bnQgIT09IGh1bmsub2xkTGluZXMpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdSZW1vdmVkIGxpbmUgY291bnQgZGlkIG5vdCBtYXRjaCBmb3IgaHVuayBhdCBsaW5lICcgKyAoY2h1bmtIZWFkZXJJbmRleCArIDEpKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gaHVuaztcbiAgfVxuXG4gIHdoaWxlIChpIDwgZGlmZnN0ci5sZW5ndGgpIHtcbiAgICBwYXJzZUluZGV4KCk7XG4gIH1cblxuICByZXR1cm4gbGlzdDtcbn1cbiJdfQ== +exports.compileGeneralSelector = compileGeneralSelector; /***/ }), -/***/ 78935: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4508: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -/*istanbul ignore start*/ - -Object.defineProperty(exports, "__esModule", ({ - value: true +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; })); -exports.arrayEqual = arrayEqual; -exports.arrayStartsWith = arrayStartsWith; - -/*istanbul ignore end*/ -function arrayEqual(a, b) { - if (a.length !== b.length) { - return false; - } - - return arrayStartsWith(a, b); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.aliases = exports.pseudos = exports.filters = exports.is = exports.selectOne = exports.selectAll = exports.prepareContext = exports._compileToken = exports._compileUnsafe = exports.compile = void 0; +var DomUtils = __importStar(__nccwpck_require__(11754)); +var boolbase_1 = __nccwpck_require__(44159); +var compile_1 = __nccwpck_require__(35030); +var subselects_1 = __nccwpck_require__(15813); +var defaultEquals = function (a, b) { return a === b; }; +var defaultOptions = { + adapter: DomUtils, + equals: defaultEquals, +}; +function convertOptionFormats(options) { + var _a, _b, _c, _d; + /* + * We force one format of options to the other one. + */ + // @ts-expect-error Default options may have incompatible `Node` / `ElementNode`. + var opts = options !== null && options !== void 0 ? options : defaultOptions; + // @ts-expect-error Same as above. + (_a = opts.adapter) !== null && _a !== void 0 ? _a : (opts.adapter = DomUtils); + // @ts-expect-error `equals` does not exist on `Options` + (_b = opts.equals) !== null && _b !== void 0 ? _b : (opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals); + return opts; } - -function arrayStartsWith(array, start) { - if (start.length > array.length) { - return false; - } - - for (var i = 0; i < start.length; i++) { - if (start[i] !== array[i]) { - return false; +function wrapCompile(func) { + return function addAdapter(selector, options, context) { + var opts = convertOptionFormats(options); + return func(selector, opts, context); + }; +} +/** + * Compiles the query, returns a function. + */ +exports.compile = wrapCompile(compile_1.compile); +exports._compileUnsafe = wrapCompile(compile_1.compileUnsafe); +exports._compileToken = wrapCompile(compile_1.compileToken); +function getSelectorFunc(searchFunc) { + return function select(query, elements, options) { + var opts = convertOptionFormats(options); + if (typeof query !== "function") { + query = (0, compile_1.compileUnsafe)(query, opts, elements); + } + var filteredElements = prepareContext(elements, opts.adapter, query.shouldTestNextSiblings); + return searchFunc(query, filteredElements, opts); + }; +} +function prepareContext(elems, adapter, shouldTestNextSiblings) { + if (shouldTestNextSiblings === void 0) { shouldTestNextSiblings = false; } + /* + * Add siblings if the query requires them. + * See https://github.com/fb55/css-select/pull/43#issuecomment-225414692 + */ + if (shouldTestNextSiblings) { + elems = appendNextSiblings(elems, adapter); } - } - - return true; + return Array.isArray(elems) + ? adapter.removeSubsets(elems) + : adapter.getChildren(elems); } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2FycmF5LmpzIl0sIm5hbWVzIjpbImFycmF5RXF1YWwiLCJhIiwiYiIsImxlbmd0aCIsImFycmF5U3RhcnRzV2l0aCIsImFycmF5Iiwic3RhcnQiLCJpIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQU8sU0FBU0EsVUFBVCxDQUFvQkMsQ0FBcEIsRUFBdUJDLENBQXZCLEVBQTBCO0FBQy9CLE1BQUlELENBQUMsQ0FBQ0UsTUFBRixLQUFhRCxDQUFDLENBQUNDLE1BQW5CLEVBQTJCO0FBQ3pCLFdBQU8sS0FBUDtBQUNEOztBQUVELFNBQU9DLGVBQWUsQ0FBQ0gsQ0FBRCxFQUFJQyxDQUFKLENBQXRCO0FBQ0Q7O0FBRU0sU0FBU0UsZUFBVCxDQUF5QkMsS0FBekIsRUFBZ0NDLEtBQWhDLEVBQXVDO0FBQzVDLE1BQUlBLEtBQUssQ0FBQ0gsTUFBTixHQUFlRSxLQUFLLENBQUNGLE1BQXpCLEVBQWlDO0FBQy9CLFdBQU8sS0FBUDtBQUNEOztBQUVELE9BQUssSUFBSUksQ0FBQyxHQUFHLENBQWIsRUFBZ0JBLENBQUMsR0FBR0QsS0FBSyxDQUFDSCxNQUExQixFQUFrQ0ksQ0FBQyxFQUFuQyxFQUF1QztBQUNyQyxRQUFJRCxLQUFLLENBQUNDLENBQUQsQ0FBTCxLQUFhRixLQUFLLENBQUNFLENBQUQsQ0FBdEIsRUFBMkI7QUFDekIsYUFBTyxLQUFQO0FBQ0Q7QUFDRjs7QUFFRCxTQUFPLElBQVA7QUFDRCIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBhcnJheUVxdWFsKGEsIGIpIHtcbiAgaWYgKGEubGVuZ3RoICE9PSBiLmxlbmd0aCkge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIHJldHVybiBhcnJheVN0YXJ0c1dpdGgoYSwgYik7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBhcnJheVN0YXJ0c1dpdGgoYXJyYXksIHN0YXJ0KSB7XG4gIGlmIChzdGFydC5sZW5ndGggPiBhcnJheS5sZW5ndGgpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBmb3IgKGxldCBpID0gMDsgaSA8IHN0YXJ0Lmxlbmd0aDsgaSsrKSB7XG4gICAgaWYgKHN0YXJ0W2ldICE9PSBhcnJheVtpXSkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0cnVlO1xufVxuIl19 +exports.prepareContext = prepareContext; +function appendNextSiblings(elem, adapter) { + // Order matters because jQuery seems to check the children before the siblings + var elems = Array.isArray(elem) ? elem.slice(0) : [elem]; + var elemsLength = elems.length; + for (var i = 0; i < elemsLength; i++) { + var nextSiblings = (0, subselects_1.getNextSiblings)(elems[i], adapter); + elems.push.apply(elems, nextSiblings); + } + return elems; +} +/** + * @template Node The generic Node type for the DOM adapter being used. + * @template ElementNode The Node type for elements for the DOM adapter being used. + * @param elems Elements to query. If it is an element, its children will be queried.. + * @param query can be either a CSS selector string or a compiled query function. + * @param [options] options for querying the document. + * @see compile for supported selector queries. + * @returns All matching elements. + * + */ +exports.selectAll = getSelectorFunc(function (query, elems, options) { + return query === boolbase_1.falseFunc || !elems || elems.length === 0 + ? [] + : options.adapter.findAll(query, elems); +}); +/** + * @template Node The generic Node type for the DOM adapter being used. + * @template ElementNode The Node type for elements for the DOM adapter being used. + * @param elems Elements to query. If it is an element, its children will be queried.. + * @param query can be either a CSS selector string or a compiled query function. + * @param [options] options for querying the document. + * @see compile for supported selector queries. + * @returns the first match, or null if there was no match. + */ +exports.selectOne = getSelectorFunc(function (query, elems, options) { + return query === boolbase_1.falseFunc || !elems || elems.length === 0 + ? null + : options.adapter.findOne(query, elems); +}); +/** + * Tests whether or not an element is matched by query. + * + * @template Node The generic Node type for the DOM adapter being used. + * @template ElementNode The Node type for elements for the DOM adapter being used. + * @param elem The element to test if it matches the query. + * @param query can be either a CSS selector string or a compiled query function. + * @param [options] options for querying the document. + * @see compile for supported selector queries. + * @returns + */ +function is(elem, query, options) { + var opts = convertOptionFormats(options); + return (typeof query === "function" ? query : (0, compile_1.compile)(query, opts))(elem); +} +exports.is = is; +/** + * Alias for selectAll(query, elems, options). + * @see [compile] for supported selector queries. + */ +exports.default = exports.selectAll; +// Export filters, pseudos and aliases to allow users to supply their own. +var pseudo_selectors_1 = __nccwpck_require__(89312); +Object.defineProperty(exports, "filters", ({ enumerable: true, get: function () { return pseudo_selectors_1.filters; } })); +Object.defineProperty(exports, "pseudos", ({ enumerable: true, get: function () { return pseudo_selectors_1.pseudos; } })); +Object.defineProperty(exports, "aliases", ({ enumerable: true, get: function () { return pseudo_selectors_1.aliases; } })); /***/ }), -/***/ 75512: +/***/ 47396: /***/ ((__unused_webpack_module, exports) => { "use strict"; -/*istanbul ignore start*/ - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.default = _default; - -/*istanbul ignore end*/ -// Iterator that traverses in the range of [min, max], stepping -// by distance from a given start position. I.e. for [0, 4], with -// start of 2, this will iterate 2, 3, 1, 4, 0. -function -/*istanbul ignore start*/ -_default -/*istanbul ignore end*/ -(start, minLine, maxLine) { - var wantForward = true, - backwardExhausted = false, - forwardExhausted = false, - localOffset = 1; - return function iterator() { - if (wantForward && !forwardExhausted) { - if (backwardExhausted) { - localOffset++; - } else { - wantForward = false; - } // Check if trying to fit beyond text length, and if not, check it fits - // after offset location (or desired location on first iteration) - - - if (start + localOffset <= maxLine) { - return localOffset; - } - - forwardExhausted = true; - } - - if (!backwardExhausted) { - if (!forwardExhausted) { - wantForward = true; - } // Check if trying to fit before text beginning, and if not, check it fits - // before offset location - - - if (minLine <= start - localOffset) { - return -localOffset++; - } - backwardExhausted = true; - return iterator(); - } // We tried to fit hunk before text beginning and beyond text length, then - // hunk can't fit on the text. Return undefined - - }; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isTraversal = exports.procedure = void 0; +exports.procedure = { + universal: 50, + tag: 30, + attribute: 1, + pseudo: 0, + "pseudo-element": 0, + descendant: -1, + child: -1, + parent: -1, + sibling: -1, + adjacent: -1, + _flexibleDescendant: -1, +}; +function isTraversal(t) { + return exports.procedure[t.type] < 0; } -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbInN0YXJ0IiwibWluTGluZSIsIm1heExpbmUiLCJ3YW50Rm9yd2FyZCIsImJhY2t3YXJkRXhoYXVzdGVkIiwiZm9yd2FyZEV4aGF1c3RlZCIsImxvY2FsT2Zmc2V0IiwiaXRlcmF0b3IiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUFBO0FBQ0E7QUFDQTtBQUNlO0FBQUE7QUFBQTtBQUFBO0FBQUEsQ0FBU0EsS0FBVCxFQUFnQkMsT0FBaEIsRUFBeUJDLE9BQXpCLEVBQWtDO0FBQy9DLE1BQUlDLFdBQVcsR0FBRyxJQUFsQjtBQUFBLE1BQ0lDLGlCQUFpQixHQUFHLEtBRHhCO0FBQUEsTUFFSUMsZ0JBQWdCLEdBQUcsS0FGdkI7QUFBQSxNQUdJQyxXQUFXLEdBQUcsQ0FIbEI7QUFLQSxTQUFPLFNBQVNDLFFBQVQsR0FBb0I7QUFDekIsUUFBSUosV0FBVyxJQUFJLENBQUNFLGdCQUFwQixFQUFzQztBQUNwQyxVQUFJRCxpQkFBSixFQUF1QjtBQUNyQkUsUUFBQUEsV0FBVztBQUNaLE9BRkQsTUFFTztBQUN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lZCA9IHRydWU7XG4gICAgICByZXR1cm4gaXRlcmF0b3IoKTtcbiAgICB9XG5cbiAgICAvLyBXZSB0cmllZCB0byBmaXQgaHVuayBiZWZvcmUgdGV4dCBiZWdpbm5pbmcgYW5kIGJleW9uZCB0ZXh0IGxlbmd0aCwgdGhlblxuICAgIC8vIGh1bmsgY2FuJ3QgZml0IG9uIHRoZSB0ZXh0LiBSZXR1cm4gdW5kZWZpbmVkXG4gIH07XG59XG4iXX0= +exports.isTraversal = isTraversal; /***/ }), -/***/ 45704: +/***/ 24176: /***/ ((__unused_webpack_module, exports) => { "use strict"; -/*istanbul ignore start*/ - - -Object.defineProperty(exports, "__esModule", ({ - value: true -})); -exports.generateOptions = generateOptions; - -/*istanbul ignore end*/ -function generateOptions(options, defaults) { - if (typeof options === 'function') { - defaults.callback = options; - } else if (options) { - for (var name in options) { - /* istanbul ignore else */ - if (options.hasOwnProperty(name)) { - defaults[name] = options[name]; - } - } - } - return defaults; -} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6WyJnZW5lcmF0ZU9wdGlvbnMiLCJvcHRpb25zIiwiZGVmYXVsdHMiLCJjYWxsYmFjayIsIm5hbWUiLCJoYXNPd25Qcm9wZXJ0eSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQU8sU0FBU0EsZUFBVCxDQUF5QkMsT0FBekIsRUFBa0NDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBT0QsT0FBUCxLQUFtQixVQUF2QixFQUFtQztBQUNqQ0MsSUFBQUEsUUFBUSxDQUFDQyxRQUFULEdBQW9CRixPQUFwQjtBQUNELEdBRkQsTUFFTyxJQUFJQSxPQUFKLEVBQWE7QUFDbEIsU0FBSyxJQUFJRyxJQUFULElBQWlCSCxPQUFqQixFQUEwQjtBQUN4QjtBQUNBLFVBQUlBLE9BQU8sQ0FBQ0ksY0FBUixDQUF1QkQsSUFBdkIsQ0FBSixFQUFrQztBQUNoQ0YsUUFBQUEsUUFBUSxDQUFDRSxJQUFELENBQVIsR0FBaUJILE9BQU8sQ0FBQ0csSUFBRCxDQUF4QjtBQUNEO0FBQ0Y7QUFDRjs7QUFDRCxTQUFPRixRQUFQO0FBQ0QiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gZ2VuZXJhdGVPcHRpb25zKG9wdGlvbnMsIGRlZmF1bHRzKSB7XG4gIGlmICh0eXBlb2Ygb3B0aW9ucyA9PT0gJ2Z1bmN0aW9uJykge1xuICAgIGRlZmF1bHRzLmNhbGxiYWNrID0gb3B0aW9ucztcbiAgfSBlbHNlIGlmIChvcHRpb25zKSB7XG4gICAgZm9yIChsZXQgbmFtZSBpbiBvcHRpb25zKSB7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgaWYgKG9wdGlvbnMuaGFzT3duUHJvcGVydHkobmFtZSkpIHtcbiAgICAgICAgZGVmYXVsdHNbbmFtZV0gPSBvcHRpb25zW25hbWVdO1xuICAgICAgfVxuICAgIH1cbiAgfVxuICByZXR1cm4gZGVmYXVsdHM7XG59XG4iXX0= +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.aliases = void 0; +/** + * Aliases are pseudos that are expressed as selectors. + */ +exports.aliases = { + // Links + "any-link": ":is(a, area, link)[href]", + link: ":any-link:not(:visited)", + // Forms + // https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements + disabled: ":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )", + enabled: ":not(:disabled)", + checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)", + required: ":is(input, select, textarea)[required]", + optional: ":is(input, select, textarea):not([required])", + // JQuery extensions + // https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness + selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)", + checkbox: "[type=checkbox]", + file: "[type=file]", + password: "[type=password]", + radio: "[type=radio]", + reset: "[type=reset]", + image: "[type=image]", + submit: "[type=submit]", + parent: ":not(:empty)", + header: ":is(h1, h2, h3, h4, h5, h6)", + button: ":is(button, input[type=button])", + input: ":is(input, textarea, select, button)", + text: "input:is(:not([type!='']), [type=text])", +}; /***/ }), -/***/ 14802: -/***/ ((__unused_webpack_module, exports) => { +/***/ 51686: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.attributeNames = exports.elementNames = void 0; -exports.elementNames = new Map([ - ["altglyph", "altGlyph"], - ["altglyphdef", "altGlyphDef"], - ["altglyphitem", "altGlyphItem"], - ["animatecolor", "animateColor"], - ["animatemotion", "animateMotion"], - ["animatetransform", "animateTransform"], - ["clippath", "clipPath"], - ["feblend", "feBlend"], - ["fecolormatrix", "feColorMatrix"], - ["fecomponenttransfer", "feComponentTransfer"], - ["fecomposite", "feComposite"], - ["feconvolvematrix", "feConvolveMatrix"], - ["fediffuselighting", "feDiffuseLighting"], - ["fedisplacementmap", "feDisplacementMap"], - ["fedistantlight", "feDistantLight"], - ["fedropshadow", "feDropShadow"], - ["feflood", "feFlood"], - ["fefunca", "feFuncA"], - ["fefuncb", "feFuncB"], - ["fefuncg", "feFuncG"], - ["fefuncr", "feFuncR"], - ["fegaussianblur", "feGaussianBlur"], - ["feimage", "feImage"], - ["femerge", "feMerge"], - ["femergenode", "feMergeNode"], - ["femorphology", "feMorphology"], - ["feoffset", "feOffset"], - ["fepointlight", "fePointLight"], - ["fespecularlighting", "feSpecularLighting"], - ["fespotlight", "feSpotLight"], - ["fetile", "feTile"], - ["feturbulence", "feTurbulence"], - ["foreignobject", "foreignObject"], - ["glyphref", "glyphRef"], - ["lineargradient", "linearGradient"], - ["radialgradient", "radialGradient"], - ["textpath", "textPath"], -]); -exports.attributeNames = new Map([ - ["definitionurl", "definitionURL"], - ["attributename", "attributeName"], - ["attributetype", "attributeType"], - ["basefrequency", "baseFrequency"], - ["baseprofile", "baseProfile"], - ["calcmode", "calcMode"], - ["clippathunits", "clipPathUnits"], - ["diffuseconstant", "diffuseConstant"], - ["edgemode", "edgeMode"], - ["filterunits", "filterUnits"], - ["glyphref", "glyphRef"], - ["gradienttransform", "gradientTransform"], - ["gradientunits", "gradientUnits"], - ["kernelmatrix", "kernelMatrix"], - ["kernelunitlength", "kernelUnitLength"], - ["keypoints", "keyPoints"], - ["keysplines", "keySplines"], - ["keytimes", "keyTimes"], - ["lengthadjust", "lengthAdjust"], - ["limitingconeangle", "limitingConeAngle"], - ["markerheight", "markerHeight"], - ["markerunits", "markerUnits"], - ["markerwidth", "markerWidth"], - ["maskcontentunits", "maskContentUnits"], - ["maskunits", "maskUnits"], - ["numoctaves", "numOctaves"], - ["pathlength", "pathLength"], - ["patterncontentunits", "patternContentUnits"], - ["patterntransform", "patternTransform"], - ["patternunits", "patternUnits"], - ["pointsatx", "pointsAtX"], - ["pointsaty", "pointsAtY"], - ["pointsatz", "pointsAtZ"], - ["preservealpha", "preserveAlpha"], - ["preserveaspectratio", "preserveAspectRatio"], - ["primitiveunits", "primitiveUnits"], - ["refx", "refX"], - ["refy", "refY"], - ["repeatcount", "repeatCount"], - ["repeatdur", "repeatDur"], - ["requiredextensions", "requiredExtensions"], - ["requiredfeatures", "requiredFeatures"], - ["specularconstant", "specularConstant"], - ["specularexponent", "specularExponent"], - ["spreadmethod", "spreadMethod"], - ["startoffset", "startOffset"], - ["stddeviation", "stdDeviation"], - ["stitchtiles", "stitchTiles"], - ["surfacescale", "surfaceScale"], - ["systemlanguage", "systemLanguage"], - ["tablevalues", "tableValues"], - ["targetx", "targetX"], - ["targety", "targetY"], - ["textlength", "textLength"], - ["viewbox", "viewBox"], - ["viewtarget", "viewTarget"], - ["xchannelselector", "xChannelSelector"], - ["ychannelselector", "yChannelSelector"], - ["zoomandpan", "zoomAndPan"], -]); +exports.filters = void 0; +var nth_check_1 = __importDefault(__nccwpck_require__(51260)); +var boolbase_1 = __nccwpck_require__(44159); +function getChildFunc(next, adapter) { + return function (elem) { + var parent = adapter.getParent(elem); + return parent != null && adapter.isTag(parent) && next(elem); + }; +} +exports.filters = { + contains: function (next, text, _a) { + var adapter = _a.adapter; + return function contains(elem) { + return next(elem) && adapter.getText(elem).includes(text); + }; + }, + icontains: function (next, text, _a) { + var adapter = _a.adapter; + var itext = text.toLowerCase(); + return function icontains(elem) { + return (next(elem) && + adapter.getText(elem).toLowerCase().includes(itext)); + }; + }, + // Location specific methods + "nth-child": function (next, rule, _a) { + var adapter = _a.adapter, equals = _a.equals; + var func = (0, nth_check_1.default)(rule); + if (func === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (func === boolbase_1.trueFunc) + return getChildFunc(next, adapter); + return function nthChild(elem) { + var siblings = adapter.getSiblings(elem); + var pos = 0; + for (var i = 0; i < siblings.length; i++) { + if (equals(elem, siblings[i])) + break; + if (adapter.isTag(siblings[i])) { + pos++; + } + } + return func(pos) && next(elem); + }; + }, + "nth-last-child": function (next, rule, _a) { + var adapter = _a.adapter, equals = _a.equals; + var func = (0, nth_check_1.default)(rule); + if (func === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (func === boolbase_1.trueFunc) + return getChildFunc(next, adapter); + return function nthLastChild(elem) { + var siblings = adapter.getSiblings(elem); + var pos = 0; + for (var i = siblings.length - 1; i >= 0; i--) { + if (equals(elem, siblings[i])) + break; + if (adapter.isTag(siblings[i])) { + pos++; + } + } + return func(pos) && next(elem); + }; + }, + "nth-of-type": function (next, rule, _a) { + var adapter = _a.adapter, equals = _a.equals; + var func = (0, nth_check_1.default)(rule); + if (func === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (func === boolbase_1.trueFunc) + return getChildFunc(next, adapter); + return function nthOfType(elem) { + var siblings = adapter.getSiblings(elem); + var pos = 0; + for (var i = 0; i < siblings.length; i++) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + break; + if (adapter.isTag(currentSibling) && + adapter.getName(currentSibling) === adapter.getName(elem)) { + pos++; + } + } + return func(pos) && next(elem); + }; + }, + "nth-last-of-type": function (next, rule, _a) { + var adapter = _a.adapter, equals = _a.equals; + var func = (0, nth_check_1.default)(rule); + if (func === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (func === boolbase_1.trueFunc) + return getChildFunc(next, adapter); + return function nthLastOfType(elem) { + var siblings = adapter.getSiblings(elem); + var pos = 0; + for (var i = siblings.length - 1; i >= 0; i--) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + break; + if (adapter.isTag(currentSibling) && + adapter.getName(currentSibling) === adapter.getName(elem)) { + pos++; + } + } + return func(pos) && next(elem); + }; + }, + // TODO determine the actual root element + root: function (next, _rule, _a) { + var adapter = _a.adapter; + return function (elem) { + var parent = adapter.getParent(elem); + return (parent == null || !adapter.isTag(parent)) && next(elem); + }; + }, + scope: function (next, rule, options, context) { + var equals = options.equals; + if (!context || context.length === 0) { + // Equivalent to :root + return exports.filters.root(next, rule, options); + } + if (context.length === 1) { + // NOTE: can't be unpacked, as :has uses this for side-effects + return function (elem) { return equals(context[0], elem) && next(elem); }; + } + return function (elem) { return context.includes(elem) && next(elem); }; + }, + hover: dynamicStatePseudo("isHovered"), + visited: dynamicStatePseudo("isVisited"), + active: dynamicStatePseudo("isActive"), +}; +/** + * Dynamic state pseudos. These depend on optional Adapter methods. + * + * @param name The name of the adapter method to call. + * @returns Pseudo for the `filters` object. + */ +function dynamicStatePseudo(name) { + return function dynamicPseudo(next, _rule, _a) { + var adapter = _a.adapter; + var func = adapter[name]; + if (typeof func !== "function") { + return boolbase_1.falseFunc; + } + return function active(elem) { + return func(elem) && next(elem); + }; + }; +} /***/ }), -/***/ 48621: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 89312: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.compilePseudoSelector = exports.aliases = exports.pseudos = exports.filters = void 0; /* - * Module dependencies - */ -var ElementType = __importStar(__nccwpck_require__(53944)); -var entities_1 = __nccwpck_require__(3000); -/** - * Mixed-case SVG and MathML tags & attributes - * recognized by the HTML parser. + * Pseudo selectors * - * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign - */ -var foreignNames_1 = __nccwpck_require__(14802); -var unencodedElements = new Set([ - "style", - "script", - "xmp", - "iframe", - "noembed", - "noframes", - "plaintext", - "noscript", -]); -/** - * Format attributes - */ -function formatAttributes(attributes, opts) { - if (!attributes) - return; - return Object.keys(attributes) - .map(function (key) { - var _a, _b; - var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : ""; - if (opts.xmlMode === "foreign") { - /* Fix up mixed-case attribute names */ - key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key; - } - if (!opts.emptyAttrs && !opts.xmlMode && value === "") { - return key; - } - return key + "=\"" + (opts.decodeEntities !== false - ? entities_1.encodeXML(value) - : value.replace(/"/g, """)) + "\""; - }) - .join(" "); -} -/** - * Self-enclosing tags - */ -var singleTag = new Set([ - "area", - "base", - "basefont", - "br", - "col", - "command", - "embed", - "frame", - "hr", - "img", - "input", - "isindex", - "keygen", - "link", - "meta", - "param", - "source", - "track", - "wbr", -]); -/** - * Renders a DOM node or an array of DOM nodes to a string. + * Pseudo selectors are available in three forms: * - * Can be thought of as the equivalent of the `outerHTML` of the passed node(s). + * 1. Filters are called when the selector is compiled and return a function + * that has to return either false, or the results of `next()`. + * 2. Pseudos are called on execution. They have to return a boolean. + * 3. Subselects work like filters, but have an embedded selector that will be run separately. * - * @param node Node to be rendered. - * @param options Changes serialization behavior + * Filters are great if you want to do some pre-processing, or change the call order + * of `next()` and your code. + * Pseudos should be used to implement simple checks. */ -function render(node, options) { - if (options === void 0) { options = {}; } - var nodes = "length" in node ? node : [node]; - var output = ""; - for (var i = 0; i < nodes.length; i++) { - output += renderNode(nodes[i], options); - } - return output; -} -exports.default = render; -function renderNode(node, options) { - switch (node.type) { - case ElementType.Root: - return render(node.children, options); - case ElementType.Directive: - case ElementType.Doctype: - return renderDirective(node); - case ElementType.Comment: - return renderComment(node); - case ElementType.CDATA: - return renderCdata(node); - case ElementType.Script: - case ElementType.Style: - case ElementType.Tag: - return renderTag(node, options); - case ElementType.Text: - return renderText(node, options); +var boolbase_1 = __nccwpck_require__(44159); +var css_what_1 = __nccwpck_require__(19218); +var filters_1 = __nccwpck_require__(51686); +Object.defineProperty(exports, "filters", ({ enumerable: true, get: function () { return filters_1.filters; } })); +var pseudos_1 = __nccwpck_require__(8952); +Object.defineProperty(exports, "pseudos", ({ enumerable: true, get: function () { return pseudos_1.pseudos; } })); +var aliases_1 = __nccwpck_require__(24176); +Object.defineProperty(exports, "aliases", ({ enumerable: true, get: function () { return aliases_1.aliases; } })); +var subselects_1 = __nccwpck_require__(15813); +function compilePseudoSelector(next, selector, options, context, compileToken) { + var name = selector.name, data = selector.data; + if (Array.isArray(data)) { + return subselects_1.subselects[name](next, data, options, context, compileToken); } -} -var foreignModeIntegrationPoints = new Set([ - "mi", - "mo", - "mn", - "ms", - "mtext", - "annotation-xml", - "foreignObject", - "desc", - "title", -]); -var foreignElements = new Set(["svg", "math"]); -function renderTag(elem, opts) { - var _a; - // Handle SVG / MathML in HTML - if (opts.xmlMode === "foreign") { - /* Fix up mixed-case element names */ - elem.name = (_a = foreignNames_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name; - /* Exit foreign mode at integration points */ - if (elem.parent && - foreignModeIntegrationPoints.has(elem.parent.name)) { - opts = __assign(__assign({}, opts), { xmlMode: false }); + if (name in aliases_1.aliases) { + if (data != null) { + throw new Error("Pseudo ".concat(name, " doesn't have any arguments")); } + // The alias has to be parsed here, to make sure options are respected. + var alias = (0, css_what_1.parse)(aliases_1.aliases[name], options); + return subselects_1.subselects.is(next, alias, options, context, compileToken); } - if (!opts.xmlMode && foreignElements.has(elem.name)) { - opts = __assign(__assign({}, opts), { xmlMode: "foreign" }); - } - var tag = "<" + elem.name; - var attribs = formatAttributes(elem.attribs, opts); - if (attribs) { - tag += " " + attribs; - } - if (elem.children.length === 0 && - (opts.xmlMode - ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags - opts.selfClosingTags !== false - : // User explicitly asked for self-closing tags, even in HTML mode - opts.selfClosingTags && singleTag.has(elem.name))) { - if (!opts.xmlMode) - tag += " "; - tag += "/>"; - } - else { - tag += ">"; - if (elem.children.length > 0) { - tag += render(elem.children, opts); - } - if (opts.xmlMode || !singleTag.has(elem.name)) { - tag += ""; - } + if (name in filters_1.filters) { + return filters_1.filters[name](next, data, options, context); } - return tag; -} -function renderDirective(elem) { - return "<" + elem.data + ">"; -} -function renderText(elem, opts) { - var data = elem.data || ""; - // If entities weren't decoded, no need to encode them back - if (opts.decodeEntities !== false && - !(!opts.xmlMode && - elem.parent && - unencodedElements.has(elem.parent.name))) { - data = entities_1.encodeXML(data); + if (name in pseudos_1.pseudos) { + var pseudo_1 = pseudos_1.pseudos[name]; + (0, pseudos_1.verifyPseudoArgs)(pseudo_1, name, data); + return pseudo_1 === boolbase_1.falseFunc + ? boolbase_1.falseFunc + : next === boolbase_1.trueFunc + ? function (elem) { return pseudo_1(elem, options, data); } + : function (elem) { return pseudo_1(elem, options, data) && next(elem); }; } - return data; -} -function renderCdata(elem) { - return ""; -} -function renderComment(elem) { - return ""; + throw new Error("unmatched pseudo-class :".concat(name)); } +exports.compilePseudoSelector = compilePseudoSelector; /***/ }), -/***/ 53944: +/***/ 8952: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0; -/** Types of elements found in htmlparser2's DOM */ -var ElementType; -(function (ElementType) { - /** Type for the root element of a document */ - ElementType["Root"] = "root"; - /** Type for Text */ - ElementType["Text"] = "text"; - /** Type for */ - ElementType["Directive"] = "directive"; - /** Type for */ - ElementType["Comment"] = "comment"; - /** Type for