diff --git a/CHANGELOG.md b/CHANGELOG.md index 11fc8498..a513334c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.0.2](https://github.com/OctopusDeploy/push-build-information-action/compare/v1.0.1...v1.0.2) (2022-07-21) + + +### Bug Fixes + +* release space name support ([#90](https://github.com/OctopusDeploy/push-build-information-action/issues/90)) ([8435c9f](https://github.com/OctopusDeploy/push-build-information-action/commit/8435c9f47f5839e916baeaea0f0c2053e7548dbe)) + ## [1.0.1](https://github.com/OctopusDeploy/push-build-information-action/compare/v1.0.0...v1.0.1) (2022-06-27) diff --git a/dist/index.js b/dist/index.js index b802893c..57500fb5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1154,7 +1154,7 @@ exports.getOctokitOptions = exports.GitHub = exports.context = void 0; const Context = __importStar(__nccwpck_require__(74087)); const Utils = __importStar(__nccwpck_require__(47914)); // octokit + plugins -const core_1 = __nccwpck_require__(76762); +const core_1 = __nccwpck_require__(18525); const plugin_rest_endpoint_methods_1 = __nccwpck_require__(83044); const plugin_paginate_rest_1 = __nccwpck_require__(64193); exports.context = new Context.Context(); @@ -1186,838 +1186,860 @@ exports.getOctokitOptions = getOctokitOptions; /***/ }), -/***/ 35526: -/***/ (function(__unused_webpack_module, exports) { +/***/ 40673: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +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 + }; +} + +/** + * 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}`; + } + + return `token ${token}`; +} + +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) + }); }; + +exports.createTokenAuth = createTokenAuth; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 18525: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; -class BasicCredentialHandler { - constructor(username, password) { - this.username = username; - this.password = password; - } - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); - } - options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); - }); - } + +var universalUserAgent = __nccwpck_require__(45030); +var beforeAfterHook = __nccwpck_require__(83682); +var request = __nccwpck_require__(89353); +var graphql = __nccwpck_require__(86422); +var authToken = __nccwpck_require__(40673); + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; } -exports.BasicCredentialHandler = BasicCredentialHandler; -class BearerCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); - } - options.headers['Authorization'] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); - }); + +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _objectWithoutPropertiesLoose(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + 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]; } + } + + return target; } -exports.BearerCredentialHandler = BearerCredentialHandler; -class PersonalAccessTokenCredentialHandler { - constructor(token) { - this.token = token; + +const VERSION = "3.6.0"; + +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 + + requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); + + if (options.baseUrl) { + requestDefaults.baseUrl = options.baseUrl; } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - if (!options.headers) { - throw Error('The request has no headers'); - } - options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + + if (options.previews) { + requestDefaults.mediaType.previews = options.previews; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + + if (options.timeZone) { + requestDefaults.headers["time-zone"] = options.timeZone; } - handleAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('not implemented'); + + 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`. + + if (!options.authStrategy) { + if (!options.auth) { + // (1) + this.auth = async () => ({ + type: "unauthenticated" }); - } + } else { + // (2) + const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ + + hook.wrap("request", auth.hook); + this.auth = auth; + } + } else { + const { + authStrategy + } = options, + otherOptions = _objectWithoutProperties(options, _excluded); + + 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 ¯\_(ツ)_/¯ + + hook.wrap("request", auth.hook); + this.auth = auth; + } // apply plugins + // https://stackoverflow.com/a/16345172 + + + const classConstructor = this.constructor; + classConstructor.plugins.forEach(plugin => { + Object.assign(this, plugin(this, options)); + }); + } + + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options = args[0] || {}; + + if (typeof defaults === "function") { + super(defaults(options)); + return; + } + + super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { + userAgent: `${options.userAgent} ${defaults.userAgent}` + } : null)); + } + + }; + return OctokitWithDefaults; + } + /** + * Attach a plugin (or many) to your Octokit instance. + * + * @example + * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) + */ + + + static plugin(...newPlugins) { + var _a; + + const currentPlugins = this.plugins; + const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); + return NewOctokit; + } + } -exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; -//# sourceMappingURL=auth.js.map +Octokit.VERSION = VERSION; +Octokit.plugins = []; + +exports.Octokit = Octokit; +//# sourceMappingURL=index.js.map + /***/ }), -/***/ 96255: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 38713: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any */ -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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; + Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(13685)); -const https = __importStar(__nccwpck_require__(95687)); -const pm = __importStar(__nccwpck_require__(19835)); -const tunnel = __importStar(__nccwpck_require__(74294)); -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); -var Headers; -(function (Headers) { - Headers["Accept"] = "accept"; - Headers["ContentType"] = "content-type"; -})(Headers = exports.Headers || (exports.Headers = {})); -var MediaTypes; -(function (MediaTypes) { - MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); -/** - * Returns the proxy URL, depending upon the supplied url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ -function getProxyUrl(serverUrl) { - const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ''; + +var isPlainObject = __nccwpck_require__(63287); +var universalUserAgent = __nccwpck_require__(45030); + +function lowercaseKeys(object) { + if (!object) { + return {}; + } + + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[key]; + return newObj; + }, {}); } -exports.getProxyUrl = getProxyUrl; -const HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -const HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = 'HttpClientError'; - this.statusCode = statusCode; - Object.setPrototypeOf(this, HttpClientError.prototype); + +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; } -exports.HttpClientError = HttpClientError; -class HttpClientResponse { - constructor(message) { - this.message = message; + +function removeUndefinedProperties(obj) { + for (const key in obj) { + if (obj[key] === undefined) { + delete obj[key]; } - readBody() { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { - let output = Buffer.alloc(0); - this.message.on('data', (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on('end', () => { - resolve(output.toString()); - }); - })); - }); + } + + return obj; +} + +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 + + + options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging + + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten + + if (defaults && defaults.mediaType.previews.length) { + mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); + } + + mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); + return mergedOptions; +} + +function addQueryParameters(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); + + if (names.length === 0) { + return url; + } + + return url + separator + names.map(name => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); } + + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); } -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === 'https:'; + +const urlVariableRegex = /\{[^}]+\}/g; + +function removeNonChars(variableName) { + return variableName.replace(/^\W+|\W+$/g, "").split(/,/); } -exports.isHttps = isHttps; -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + +function extractUrlVariableNames(url) { + const matches = url.match(urlVariableRegex); + + if (!matches) { + return []; + } + + return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); +} + +function omit(object, keysToOmit) { + return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { + obj[key] = object[key]; + return obj; + }, {}); +} + +// 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; +} + +function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; +} + +function getValues(context, operator, key, modifier) { + var value = context[key], + result = []; + + 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)); } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + }); + } + } else { + const tmp = []; + + 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())); } + }); } + + if (isKeyOperator(operator)) { + result.push(encodeUnreserved(key) + "=" + tmp.join(",")); + } else if (tmp.length !== 0) { + result.push(tmp.join(",")); + } + } } - options(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('GET', requestUrl, null, additionalHeaders || {}); - }); + } else { + if (operator === ";") { + if (isDefined(value)) { + result.push(encodeUnreserved(key)); + } + } else if (value === "" && (operator === "&" || operator === "?")) { + result.push(encodeUnreserved(key) + "="); + } else if (value === "") { + result.push(""); } - del(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); - }); + } + + return result; +} + +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); + } + + expression.split(/,/g).forEach(function (variable) { + var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); + values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); + }); + + 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); } - post(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('POST', requestUrl, data, additionalHeaders || {}); - }); + }); +} + +function parse(options) { + // https://fetch.spec.whatwg.org/#methods + let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible + + 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; + } + + 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); + + 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(","); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); - }); + + 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(","); } - put(requestUrl, data, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); - }); + } // for GET/HEAD requests, set URL query parameters from remaining parameters + // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters + + + 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; + } } - head(requestUrl, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); - }); + } // default content-type for JSON if body is set + + + 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 (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { + body = ""; + } // Only return body/request keys if present + + + return Object.assign({ + method, + url, + headers + }, typeof body !== "undefined" ? { + body + } : null, options.request ? { + request: options.request + } : null); +} + +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"; + +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 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 + + +/***/ }), + +/***/ 86422: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var request = __nccwpck_require__(89353); +var universalUserAgent = __nccwpck_require__(45030); + +const VERSION = "4.8.0"; + +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) + + /* istanbul ignore next */ + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + } + +} + +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`)); } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - const res = yield this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + + 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`)); } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + } + + 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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + + if (!result.variables) { + result.variables = {}; } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter(this, void 0, void 0, function* () { - const data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - const res = yield this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - }); + + 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"); + } + + return request(requestOptions).then(response => { + if (response.data.errors) { + const headers = {}; + + for (const key of Object.keys(response.headers)) { + headers[key] = response.headers[key]; + } + + throw new GraphqlResponseError(requestOptions, headers, response.data); } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error('Client has already been disposed.'); - } - const parsedUrl = new URL(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) - ? this._maxRetries + 1 - : 1; - let numTries = 0; - let response; - do { - response = yield this.requestRaw(info, data); - // Check if it's an authentication challenge - if (response && - response.message && - response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); - } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; - } - } - let redirectsRemaining = this._maxRedirects; - while (response.message.statusCode && - HttpRedirectCodes.includes(response.message.statusCode) && - this._allowRedirects && - redirectsRemaining > 0) { - const redirectUrl = response.message.headers['location']; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; - } - const parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol === 'https:' && - parsedUrl.protocol !== parsedRedirectUrl.protocol && - !this._allowRedirectDowngrade) { - throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); - } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - yield response.readBody(); - // strip authorization header if redirected to a different hostname - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - // header names are case insensitive - if (header.toLowerCase() === 'authorization') { - delete headers[header]; - } - } - } - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info, data); - redirectsRemaining--; - } - if (!response.message.statusCode || - !HttpResponseRetryCodes.includes(response.message.statusCode)) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); - } - } while (numTries < maxTries); - return response; - }); - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info, data) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } - else if (!res) { - // If `err` is not passed, then `res` must be passed. - reject(new Error('Unknown error')); - } - else { - resolve(res); - } - } - this.requestRawWithCallback(info, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - if (typeof data === 'string') { - if (!info.options.headers) { - info.options.headers = {}; - } - info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info.httpModule.request(info.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(undefined, res); - }); - let socket; - req.on('socket', sock => { - socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { - if (socket) { - socket.end(); - } - handleResult(new Error(`Request timeout: ${info.options.path}`)); - }); - req.on('error', function (err) { - // err has statusCode property - // res should have headers - handleResult(err); - }); - if (data && typeof data === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof data !== 'string') { - data.on('close', function () { - req.end(); - }); - data.pipe(req); - } - else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port - ? parseInt(info.parsedUrl.port) - : defaultPort; - info.options.path = - (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers['user-agent'] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info.options); - } - } - return info; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; - } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - // if agent is already assigned use that agent. - if (agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. - if (proxyUrl && proxyUrl.hostname) { - const agentOptions = { - maxSockets, - keepAlive: this._keepAlive, - proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - })), { host: proxyUrl.hostname, port: proxyUrl.port }) - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === 'https:'; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } - else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode === HttpCodes.NotFound) { - resolve(response); - } - // get the result from the body - function dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - let obj; - let contents; - try { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); - } - response.result = obj; - } - response.headers = res.message.headers; - } - catch (err) { - // Invalid resource (contents not json); leaving result obj null - } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; - } - else { - msg = `Failed request: (${statusCode})`; - } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } - else { - resolve(response); - } - })); - }); - } -} -exports.HttpClient = HttpClient; -const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); -//# sourceMappingURL=index.js.map -/***/ }), + return response.data.data; + }); +} -/***/ 19835: -/***/ ((__unused_webpack_module, exports) => { +function withDefaults(request$1, newDefaults) { + const newRequest = request$1.defaults(newDefaults); -"use strict"; + const newApi = (query, options) => { + return graphql(newRequest, query, options); + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.checkBypass = exports.getProxyUrl = void 0; -function getProxyUrl(reqUrl) { - const usingSsl = reqUrl.protocol === 'https:'; - if (checkBypass(reqUrl)) { - return undefined; - } - const proxyVar = (() => { - if (usingSsl) { - return process.env['https_proxy'] || process.env['HTTPS_PROXY']; - } - else { - return process.env['http_proxy'] || process.env['HTTP_PROXY']; - } - })(); - if (proxyVar) { - return new URL(proxyVar); - } - else { - return undefined; - } + return Object.assign(newApi, { + defaults: withDefaults.bind(null, newRequest), + endpoint: request.request.endpoint + }); } -exports.getProxyUrl = getProxyUrl; -function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; - if (!noProxy) { - return false; - } - // Determine the request port - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } - else if (reqUrl.protocol === 'http:') { - reqPort = 80; - } - else if (reqUrl.protocol === 'https:') { - reqPort = 443; - } - // Format the request hostname and hostname with port - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === 'number') { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - // Compare request host against noproxy - for (const upperNoProxyItem of noProxy - .split(',') - .map(x => x.trim().toUpperCase()) - .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { - return true; - } - } - return false; + +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" + }); } -exports.checkBypass = checkBypass; -//# sourceMappingURL=proxy.js.map + +exports.GraphqlResponseError = GraphqlResponseError; +exports.graphql = graphql$1; +exports.withCustomRequest = withCustomRequest; +//# sourceMappingURL=index.js.map + /***/ }), -/***/ 40334: -/***/ ((__unused_webpack_module, exports) => { +/***/ 37471: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -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 - }; -} +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)); /** - * Prefix token for usage in the Authorization header - * - * @param token OAuth token or JSON Web Token + * Error with extra properties to help with debugging */ -function withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; - } - return `token ${token}`; -} +class RequestError extends Error { + constructor(message, statusCode, options) { + super(message); // Maintains proper stack trace (only available on V8) -async function hook(token, request, route, parameters) { - const endpoint = request.endpoint.merge(route, parameters); - endpoint.headers.authorization = withAuthorizationPrefix(token); - return request(endpoint); -} + /* istanbul ignore next */ -const createTokenAuth = function createTokenAuth(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); - } + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } - if (typeof token !== "string") { - throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string"); + this.name = "HttpError"; + this.status = statusCode; + let headers; + + if ("headers" in options && typeof options.headers !== "undefined") { + headers = options.headers; + } + + if ("response" in options) { + this.response = options.response; + headers = options.response.headers; + } // redact request credentials without mutating original request options + + + const requestCopy = Object.assign({}, options.request); + + if (options.request.headers.authorization) { + requestCopy.headers = Object.assign({}, options.request.headers, { + authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") + }); + } + + 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 + + Object.defineProperty(this, "code", { + get() { + logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); + return statusCode; + } + + }); + Object.defineProperty(this, "headers", { + get() { + logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); + return headers || {}; + } + + }); } - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); -}; +} -exports.createTokenAuth = createTokenAuth; +exports.RequestError = RequestError; //# sourceMappingURL=index.js.map /***/ }), -/***/ 76762: +/***/ 89353: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2025,703 +2047,948 @@ exports.createTokenAuth = createTokenAuth; Object.defineProperty(exports, "__esModule", ({ value: true })); +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var endpoint = __nccwpck_require__(38713); 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); +var isPlainObject = __nccwpck_require__(63287); +var nodeFetch = _interopDefault(__nccwpck_require__(80467)); +var requestError = __nccwpck_require__(37471); -function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return {}; - var target = {}; - var sourceKeys = Object.keys(source); - var key, i; - - for (i = 0; i < sourceKeys.length; i++) { - key = sourceKeys[i]; - if (excluded.indexOf(key) >= 0) continue; - target[key] = source[key]; - } +const VERSION = "5.6.3"; - return target; +function getBufferResponse(response) { + return response.arrayBuffer(); } -function _objectWithoutProperties(source, excluded) { - if (source == null) return {}; +function fetchWrapper(requestOptions) { + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; - var target = _objectWithoutPropertiesLoose(source, excluded); + if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); + } - var key, i; + 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; - if (Object.getOwnPropertySymbols) { - var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (const keyAndValue of response.headers) { + headers[keyAndValue[0]] = keyAndValue[1]; + } - 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 ("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}` : ""}`); } - } - return target; -} + if (status === 204 || status === 205) { + return; + } // GitHub API returns 200 for HEAD requests -const VERSION = "3.6.0"; -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: "" + if (requestOptions.method === "HEAD") { + if (status < 400) { + return; } - }; // prepend default user agent with `options.userAgent` if set - requestDefaults.headers["user-agent"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(" "); - - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; + throw new requestError.RequestError(response.statusText, status, { + response: { + url, + status, + headers, + data: undefined + }, + request: requestOptions + }); } - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; + if (status === 304) { + throw new requestError.RequestError("Not modified", status, { + response: { + url, + status, + headers, + data: await getResponseData(response) + }, + request: requestOptions + }); } - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; + 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; } - 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`. - - if (!options.authStrategy) { - if (!options.auth) { - // (1) - this.auth = async () => ({ - type: "unauthenticated" - }); - } else { - // (2) - const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\_(ツ)_/¯ - - hook.wrap("request", auth.hook); - this.auth = auth; - } - } else { - const { - authStrategy - } = options, - otherOptions = _objectWithoutProperties(options, _excluded); - - 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 ¯\_(ツ)_/¯ - - hook.wrap("request", auth.hook); - this.auth = auth; - } // apply plugins - // https://stackoverflow.com/a/16345172 - - - const classConstructor = this.constructor; - classConstructor.plugins.forEach(plugin => { - Object.assign(this, plugin(this, options)); - }); - } - - static defaults(defaults) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; - - if (typeof defaults === "function") { - super(defaults(options)); - return; - } - - super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? { - userAgent: `${options.userAgent} ${defaults.userAgent}` - } : null)); - } - + return getResponseData(response); + }).then(data => { + return { + status, + url, + headers, + data }; - return OctokitWithDefaults; - } - /** - * Attach a plugin (or many) to your Octokit instance. - * - * @example - * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...) - */ - - - static plugin(...newPlugins) { - var _a; - - const currentPlugins = this.plugins; - const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a); - return NewOctokit; - } - + }).catch(error => { + if (error instanceof requestError.RequestError) throw error; + throw new requestError.RequestError(error.message, 500, { + request: requestOptions + }); + }); } -Octokit.VERSION = VERSION; -Octokit.plugins = []; - -exports.Octokit = Octokit; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 59440: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var isPlainObject = __nccwpck_require__(63287); -var universalUserAgent = __nccwpck_require__(45030); +async function getResponseData(response) { + const contentType = response.headers.get("content-type"); -function lowercaseKeys(object) { - if (!object) { - return {}; + if (/application\/json/.test(contentType)) { + return response.json(); } - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[key]; - return newObj; - }, {}); -} - -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; -} - -function removeUndefinedProperties(obj) { - for (const key in obj) { - if (obj[key] === undefined) { - delete obj[key]; - } + if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { + return response.text(); } - return obj; + return getBufferResponse(response); } -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 - +function toErrorMessage(data) { + if (typeof data === "string") return data; // istanbul ignore else - just in case - options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging + if ("message" in data) { + if (Array.isArray(data.errors)) { + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + } - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten + return data.message; + } // istanbul ignore next - just in case - if (defaults && defaults.mediaType.previews.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews); - } - mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, "")); - return mergedOptions; + return `Unknown error: ${JSON.stringify(data)}`; } -function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); +function withDefaults(oldEndpoint, newDefaults) { + const endpoint = oldEndpoint.defaults(newDefaults); - if (names.length === 0) { - return url; - } + const newApi = function (route, parameters) { + const endpointOptions = endpoint.merge(route, parameters); - return url + separator + names.map(name => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + if (!endpointOptions.request || !endpointOptions.request.hook) { + return fetchWrapper(endpoint.parse(endpointOptions)); } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); -} + const request = (route, parameters) => { + return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); + }; -const urlVariableRegex = /\{[^}]+\}/g; + Object.assign(request, { + endpoint, + defaults: withDefaults.bind(null, endpoint) + }); + return endpointOptions.request.hook(request, endpointOptions); + }; -function removeNonChars(variableName) { - return variableName.replace(/^\W+|\W+$/g, "").split(/,/); + return Object.assign(newApi, { + endpoint, + defaults: withDefaults.bind(null, endpoint) + }); } -function extractUrlVariableNames(url) { - const matches = url.match(urlVariableRegex); - - if (!matches) { - return []; +const request = withDefaults(endpoint.endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}` } +}); - return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []); -} - -function omit(object, keysToOmit) { - return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => { - obj[key] = object[key]; - return obj; - }, {}); -} - -// 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. +exports.request = request; +//# sourceMappingURL=index.js.map -/* 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(); - }); -} +/***/ 35526: +/***/ (function(__unused_webpack_module, exports) { -function encodeValue(operator, value, key) { - value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value); +"use strict"; - if (key) { - return encodeUnreserved(key) + "=" + value; - } else { - return value; - } +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } } - -function isDefined(value) { - return value !== undefined && value !== null; +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } } - -function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } } +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; +//# sourceMappingURL=auth.js.map -function getValues(context, operator, key, modifier) { - var value = context[key], - result = []; +/***/ }), - if (isDefined(value) && value !== "") { - if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { - value = value.toString(); +/***/ 96255: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - if (modifier && modifier !== "*") { - value = value.substring(0, parseInt(modifier, 10)); - } +"use strict"; - 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 (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())); - } - }); - } - - if (isKeyOperator(operator)) { - result.push(encodeUnreserved(key) + "=" + tmp.join(",")); - } else if (tmp.length !== 0) { - result.push(tmp.join(",")); - } - } +/* eslint-disable @typescript-eslint/no-explicit-any */ +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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; +const http = __importStar(__nccwpck_require__(13685)); +const https = __importStar(__nccwpck_require__(95687)); +const pm = __importStar(__nccwpck_require__(19835)); +const tunnel = __importStar(__nccwpck_require__(74294)); +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers = exports.Headers || (exports.Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); +/** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ +function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; +} +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); } - } else { - if (operator === ";") { - if (isDefined(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); +} +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + })); + }); } - } - - return result; } - -function parseUrl(template) { - return { - expand: expand.bind(null, template) - }; +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; } - -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); - } - - expression.split(/,/g).forEach(function (variable) { - var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3])); - }); - - if (operator && operator !== "+") { - var separator = ","; - - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } } - - return (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); - } - } else { - return encodeReserved(literal); } - }); -} - -function parse(options) { - // https://fetch.spec.whatwg.org/#methods - let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible - - 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; - } - - 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); - - 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(","); + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + }); } - - 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(","); + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + }); } - } // for GET/HEAD requests, set URL query parameters from remaining parameters - // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters - - - 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; - } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); } - } // default content-type for JSON if body is set - - - 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 (["PATCH", "PUT"].includes(method) && typeof body === "undefined") { - body = ""; - } // Only return body/request keys if present - - - return Object.assign({ - method, - url, - headers - }, typeof body !== "undefined" ? { - body - } : null, options.request ? { - request: options.request - } : null); -} - -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"; - -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 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 - - -/***/ }), - -/***/ 88467: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var request = __nccwpck_require__(36234); -var universalUserAgent = __nccwpck_require__(45030); - -const VERSION = "4.8.0"; - -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) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); } - } - -} - -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`)); + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); } - - 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`)); + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); } - } - - 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; + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + }); } - - if (!result.variables) { - result.variables = {}; + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } - - 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"); - } - - return request(requestOptions).then(response => { - if (response.data.errors) { - const headers = {}; - - for (const key of Object.keys(response.headers)) { - headers[key] = response.headers[key]; - } - - throw new GraphqlResponseError(requestOptions, headers, response.data); + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === 'https:' && + parsedUrl.protocol !== parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response.message.statusCode || + !HttpResponseRetryCodes.includes(response.message.statusCode)) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } + else if (!res) { + // If `err` is not passed, then `res` must be passed. + reject(new Error('Unknown error')); + } + else { + resolve(res); + } + } + this.requestRawWithCallback(info, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + if (typeof data === 'string') { + if (!info.options.headers) { + info.options.headers = {}; + } + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(undefined, res); + }); + let socket; + req.on('socket', sock => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info.options.path}`)); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info.options); + } + } + return info; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (this._keepAlive && !useProxy) { + agent = this._agent; + } + // if agent is already assigned use that agent. + if (agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + })), { host: proxyUrl.hostname, port: proxyUrl.port }) + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; + } + _performExponentialBackoff(retryNumber) { + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + // get the result from the body + function dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } + else { + resolve(response); + } + })); + }); + } +} +exports.HttpClient = HttpClient; +const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); +//# sourceMappingURL=index.js.map + +/***/ }), - return response.data.data; - }); -} - -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 - }); -} - -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" - }); -} - -exports.GraphqlResponseError = GraphqlResponseError; -exports.graphql = graphql$1; -exports.withCustomRequest = withCustomRequest; -//# sourceMappingURL=index.js.map - +/***/ 19835: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.checkBypass = exports.getProxyUrl = void 0; +function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === 'https:'; + if (checkBypass(reqUrl)) { + return undefined; + } + const proxyVar = (() => { + if (usingSsl) { + return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + })(); + if (proxyVar) { + return new URL(proxyVar); + } + else { + return undefined; + } +} +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; + } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } + else if (reqUrl.protocol === 'http:') { + reqPort = 80; + } + else if (reqUrl.protocol === 'https:') { + reqPort = 443; + } + // Format the request hostname and hostname with port + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (const upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperReqHosts.some(x => x === upperNoProxyItem)) { + return true; + } + } + return false; +} +exports.checkBypass = checkBypass; +//# sourceMappingURL=proxy.js.map /***/ }), @@ -2733,21 +3000,16 @@ exports.withCustomRequest = withCustomRequest; Object.defineProperty(exports, "__esModule", ({ value: true })); -const VERSION = "2.17.0"; +const VERSION = "2.21.2"; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); 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); + enumerableOnly && (symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); } return keys; @@ -2755,19 +3017,12 @@ function ownKeys(object, enumerableOnly) { 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)); - }); - } + var source = null != arguments[i] ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); } return target; @@ -2917,7 +3172,7 @@ 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"]; +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}/audit-log", "GET /enterprises/{enterprise}/secret-scanning/alerts", "GET /enterprises/{enterprise}/settings/billing/advanced-security", "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 /licenses", "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/cache/usage-by-repository", "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/secrets", "GET /orgs/{org}/actions/secrets/{secret_name}/repositories", "GET /orgs/{org}/audit-log", "GET /orgs/{org}/blocks", "GET /orgs/{org}/code-scanning/alerts", "GET /orgs/{org}/codespaces", "GET /orgs/{org}/credential-authorizations", "GET /orgs/{org}/dependabot/secrets", "GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories", "GET /orgs/{org}/events", "GET /orgs/{org}/external-groups", "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}/packages/{package_type}/{package_name}/versions", "GET /orgs/{org}/projects", "GET /orgs/{org}/public_members", "GET /orgs/{org}/repos", "GET /orgs/{org}/secret-scanning/alerts", "GET /orgs/{org}/settings/billing/advanced-security", "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}/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/caches", "GET /repos/{owner}/{repo}/actions/runners", "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}/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}/codespaces", "GET /repos/{owner}/{repo}/codespaces/devcontainers", "GET /repos/{owner}/{repo}/codespaces/secrets", "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}/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}/status", "GET /repos/{owner}/{repo}/commits/{ref}/statuses", "GET /repos/{owner}/{repo}/contributors", "GET /repos/{owner}/{repo}/dependabot/secrets", "GET /repos/{owner}/{repo}/deployments", "GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses", "GET /repos/{owner}/{repo}/environments", "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}/releases/{release_id}/reactions", "GET /repos/{owner}/{repo}/secret-scanning/alerts", "GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", "GET /repos/{owner}/{repo}/stargazers", "GET /repos/{owner}/{repo}/subscribers", "GET /repos/{owner}/{repo}/tags", "GET /repos/{owner}/{repo}/teams", "GET /repos/{owner}/{repo}/topics", "GET /repositories", "GET /repositories/{repository_id}/environments/{environment_name}/secrets", "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}/teams", "GET /user/blocks", "GET /user/codespaces", "GET /user/codespaces/secrets", "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/packages/{package_type}/{package_name}/versions", "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") { @@ -3013,6 +3268,8 @@ function _defineProperty(obj, key, value) { const Endpoints = { actions: { + addCustomLabelsToSelfHostedRunnerForOrg: ["POST /orgs/{org}/actions/runners/{runner_id}/labels"], + addCustomLabelsToSelfHostedRunnerForRepo: ["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], 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"], @@ -3024,6 +3281,8 @@ const Endpoints = { 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"], + deleteActionsCacheById: ["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"], + deleteActionsCacheByKey: ["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"], 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}"], @@ -3040,11 +3299,19 @@ const Endpoints = { 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"], + getActionsCacheList: ["GET /repos/{owner}/{repo}/actions/caches"], + getActionsCacheUsage: ["GET /repos/{owner}/{repo}/actions/cache/usage"], + getActionsCacheUsageByRepoForOrg: ["GET /orgs/{org}/actions/cache/usage-by-repository"], + getActionsCacheUsageForEnterprise: ["GET /enterprises/{enterprise}/actions/cache/usage"], + getActionsCacheUsageForOrg: ["GET /orgs/{org}/actions/cache/usage"], 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}"], + getGithubActionsDefaultWorkflowPermissionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/workflow"], + getGithubActionsDefaultWorkflowPermissionsOrganization: ["GET /orgs/{org}/actions/permissions/workflow"], + getGithubActionsDefaultWorkflowPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions/workflow"], getGithubActionsPermissionsOrganization: ["GET /orgs/{org}/actions/permissions"], getGithubActionsPermissionsRepository: ["GET /repos/{owner}/{repo}/actions/permissions"], getJobForWorkflowRun: ["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"], @@ -3060,6 +3327,7 @@ const Endpoints = { 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}"], + getWorkflowAccessToRepository: ["GET /repos/{owner}/{repo}/actions/permissions/access"], 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"], @@ -3068,6 +3336,8 @@ const Endpoints = { 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"], + listLabelsForSelfHostedRunnerForOrg: ["GET /orgs/{org}/actions/runners/{runner_id}/labels"], + listLabelsForSelfHostedRunnerForRepo: ["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], listOrgSecrets: ["GET /orgs/{org}/actions/secrets"], listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"], listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"], @@ -3080,14 +3350,27 @@ const Endpoints = { 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"], + reRunJobForWorkflowRun: ["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"], + reRunWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"], + reRunWorkflowFailedJobs: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"], + removeAllCustomLabelsFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"], + removeAllCustomLabelsFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + removeCustomLabelFromSelfHostedRunnerForOrg: ["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"], + removeCustomLabelFromSelfHostedRunnerForRepo: ["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"], 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"], + setCustomLabelsForSelfHostedRunnerForOrg: ["PUT /orgs/{org}/actions/runners/{runner_id}/labels"], + setCustomLabelsForSelfHostedRunnerForRepo: ["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"], + setGithubActionsDefaultWorkflowPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/workflow"], + setGithubActionsDefaultWorkflowPermissionsOrganization: ["PUT /orgs/{org}/actions/permissions/workflow"], + setGithubActionsDefaultWorkflowPermissionsRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/workflow"], 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"] + setSelectedRepositoriesEnabledGithubActionsOrganization: ["PUT /orgs/{org}/actions/permissions/repositories"], + setWorkflowAccessToRepository: ["PUT /repos/{owner}/{repo}/actions/permissions/access"] }, activity: { checkRepoIsStarredByAuthenticatedUser: ["GET /user/starred/{owner}/{repo}"], @@ -3128,16 +3411,6 @@ const Endpoints = { }], 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"] - } - }], - createContentAttachmentForRepo: ["POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments", { - mediaType: { - previews: ["corsair"] - } - }], createFromManifest: ["POST /app-manifests/{code}/conversions"], createInstallationAccessToken: ["POST /app/installations/{installation_id}/access_tokens"], deleteAuthorization: ["DELETE /applications/{client_id}/grant"], @@ -3179,6 +3452,8 @@ const Endpoints = { billing: { getGithubActionsBillingOrg: ["GET /orgs/{org}/settings/billing/actions"], getGithubActionsBillingUser: ["GET /users/{username}/settings/billing/actions"], + getGithubAdvancedSecurityBillingGhe: ["GET /enterprises/{enterprise}/settings/billing/advanced-security"], + getGithubAdvancedSecurityBillingOrg: ["GET /orgs/{org}/settings/billing/advanced-security"], getGithubPackagesBillingOrg: ["GET /orgs/{org}/settings/billing/packages"], getGithubPackagesBillingUser: ["GET /users/{username}/settings/billing/packages"], getSharedStorageBillingOrg: ["GET /orgs/{org}/settings/billing/shared-storage"], @@ -3208,6 +3483,7 @@ const Endpoints = { 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"], + listAlertsForOrg: ["GET /orgs/{org}/code-scanning/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/code-scanning/alerts"], listAlertsInstances: ["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", {}, { renamed: ["codeScanning", "listAlertInstances"] @@ -3220,16 +3496,80 @@ const Endpoints = { getAllCodesOfConduct: ["GET /codes_of_conduct"], getConductCode: ["GET /codes_of_conduct/{key}"] }, + codespaces: { + addRepositoryForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], + codespaceMachinesForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/machines"], + createForAuthenticatedUser: ["POST /user/codespaces"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + createOrUpdateSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}"], + createWithPrForAuthenticatedUser: ["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"], + createWithRepoForAuthenticatedUser: ["POST /repos/{owner}/{repo}/codespaces"], + deleteForAuthenticatedUser: ["DELETE /user/codespaces/{codespace_name}"], + deleteFromOrganization: ["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + deleteSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}"], + exportForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/exports"], + getExportDetailsForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}/exports/{export_id}"], + getForAuthenticatedUser: ["GET /user/codespaces/{codespace_name}"], + getPublicKeyForAuthenticatedUser: ["GET /user/codespaces/secrets/public-key"], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"], + getSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}"], + listDevcontainersInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/devcontainers"], + listForAuthenticatedUser: ["GET /user/codespaces"], + listInOrganization: ["GET /orgs/{org}/codespaces", {}, { + renamedParameters: { + org_id: "org" + } + }], + listInRepositoryForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/codespaces/secrets"], + listRepositoriesForSecretForAuthenticatedUser: ["GET /user/codespaces/secrets/{secret_name}/repositories"], + listSecretsForAuthenticatedUser: ["GET /user/codespaces/secrets"], + removeRepositoryForSecretForAuthenticatedUser: ["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"], + repoMachinesForAuthenticatedUser: ["GET /repos/{owner}/{repo}/codespaces/machines"], + setRepositoriesForSecretForAuthenticatedUser: ["PUT /user/codespaces/secrets/{secret_name}/repositories"], + startForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/start"], + stopForAuthenticatedUser: ["POST /user/codespaces/{codespace_name}/stop"], + stopInOrganization: ["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"], + updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] + }, + dependabot: { + addSelectedRepoToOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], + createOrUpdateOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}"], + createOrUpdateRepoSecret: ["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + deleteOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"], + deleteRepoSecret: ["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + getOrgPublicKey: ["GET /orgs/{org}/dependabot/secrets/public-key"], + getOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}"], + getRepoPublicKey: ["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"], + getRepoSecret: ["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"], + listOrgSecrets: ["GET /orgs/{org}/dependabot/secrets"], + listRepoSecrets: ["GET /repos/{owner}/{repo}/dependabot/secrets"], + listSelectedReposForOrgSecret: ["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"], + removeSelectedRepoFromOrgSecret: ["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"], + setSelectedReposForOrgSecret: ["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"] + }, + dependencyGraph: { + createRepositorySnapshot: ["POST /repos/{owner}/{repo}/dependency-graph/snapshots"], + diffRange: ["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"] + }, emojis: { get: ["GET /emojis"] }, enterpriseAdmin: { + addCustomLabelsToSelfHostedRunnerForEnterprise: ["POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], 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"], + getServerStatistics: ["GET /enterprise-installation/{enterprise_or_org}/server-statistics"], + listLabelsForSelfHostedRunnerForEnterprise: ["GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], listSelectedOrganizationsEnabledGithubActionsEnterprise: ["GET /enterprises/{enterprise}/actions/permissions/organizations"], + removeAllCustomLabelsFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], + removeCustomLabelFromSelfHostedRunnerForEnterprise: ["DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}"], setAllowedActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/selected-actions"], + setCustomLabelsForSelfHostedRunnerForEnterprise: ["PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels"], setGithubActionsPermissionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions"], setSelectedOrganizationsEnabledGithubActionsEnterprise: ["PUT /enterprises/{enterprise}/actions/permissions/organizations"] }, @@ -3400,6 +3740,7 @@ const Endpoints = { list: ["GET /organizations"], listAppInstallations: ["GET /orgs/{org}/installations"], listBlockedUsers: ["GET /orgs/{org}/blocks"], + listCustomRoles: ["GET /organizations/{organization_id}/custom_roles"], listFailedInvitations: ["GET /orgs/{org}/failed_invitations"], listForAuthenticatedUser: ["GET /user/orgs"], listForUser: ["GET /users/{username}/orgs"], @@ -3528,12 +3869,14 @@ const Endpoints = { 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}"], + deleteForRelease: ["DELETE /repos/{owner}/{repo}/releases/{release_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"], + listForRelease: ["GET /repos/{owner}/{repo}/releases/{release_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"] }, @@ -3557,6 +3900,7 @@ const Endpoints = { }], checkCollaborator: ["GET /repos/{owner}/{repo}/collaborators/{username}"], checkVulnerabilityAlerts: ["GET /repos/{owner}/{repo}/vulnerability-alerts"], + codeownersErrors: ["GET /repos/{owner}/{repo}/codeowners/errors"], compareCommits: ["GET /repos/{owner}/{repo}/compare/{base}...{head}"], compareCommitsWithBasehead: ["GET /repos/{owner}/{repo}/compare/{basehead}"], createAutolink: ["POST /repos/{owner}/{repo}/autolinks"], @@ -3574,6 +3918,7 @@ const Endpoints = { createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"], createRelease: ["POST /repos/{owner}/{repo}/releases"], + createTagProtection: ["POST /repos/{owner}/{repo}/tags/protection"], createUsingTemplate: ["POST /repos/{template_owner}/{template_repo}/generate"], createWebhook: ["POST /repos/{owner}/{repo}/hooks"], declineInvitation: ["DELETE /user/repository_invitations/{invitation_id}", {}, { @@ -3596,6 +3941,7 @@ const Endpoints = { 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}"], + deleteTagProtection: ["DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}"], deleteWebhook: ["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"], disableAutomatedSecurityFixes: ["DELETE /repos/{owner}/{repo}/automated-security-fixes"], disableLfsForRepo: ["DELETE /repos/{owner}/{repo}/lfs"], @@ -3614,11 +3960,7 @@ const Endpoints = { 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"] - } - }], + getAllTopics: ["GET /repos/{owner}/{repo}/topics"], 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}"], @@ -3684,6 +4026,7 @@ const Endpoints = { listPullRequestsAssociatedWithCommit: ["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"], listReleaseAssets: ["GET /repos/{owner}/{repo}/releases/{release_id}/assets"], listReleases: ["GET /repos/{owner}/{repo}/releases"], + listTagProtection: ["GET /repos/{owner}/{repo}/tags/protection"], listTags: ["GET /repos/{owner}/{repo}/tags"], listTeams: ["GET /repos/{owner}/{repo}/teams"], listWebhookDeliveries: ["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"], @@ -3707,11 +4050,7 @@ const Endpoints = { mapToData: "users" }], renameBranch: ["POST /repos/{owner}/{repo}/branches/{branch}/rename"], - replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics", { - mediaType: { - previews: ["mercy"] - } - }], + replaceAllTopics: ["PUT /repos/{owner}/{repo}/topics"], 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", {}, { @@ -3752,17 +4091,15 @@ const Endpoints = { issuesAndPullRequests: ["GET /search/issues"], labels: ["GET /search/labels"], repos: ["GET /search/repositories"], - topics: ["GET /search/topics", { - mediaType: { - previews: ["mercy"] - } - }], + topics: ["GET /search/topics"], users: ["GET /search/users"] }, secretScanning: { getAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"], + listAlertsForEnterprise: ["GET /enterprises/{enterprise}/secret-scanning/alerts"], listAlertsForOrg: ["GET /orgs/{org}/secret-scanning/alerts"], listAlertsForRepo: ["GET /repos/{owner}/{repo}/secret-scanning/alerts"], + listLocationsForAlert: ["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"], updateAlert: ["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"] }, teams: { @@ -3878,398 +4215,8357 @@ const Endpoints = { } }; -const VERSION = "5.13.0"; +const VERSION = "5.16.2"; 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); + 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] = {}; + } + + const scopeMethods = newMethods[scope]; + + if (decorations) { + scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); + continue; + } + + scopeMethods[methodName] = octokit.request.defaults(endpointDefaults); + } + } + + return newMethods; +} + +function decorate(octokit, scope, methodName, defaults, decorations) { + const requestWithDefaults = octokit.request.defaults(defaults); + /* istanbul ignore next */ + + 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 (decorations.mapToData) { + options = Object.assign({}, options, { + data: options[decorations.mapToData], + [decorations.mapToData]: undefined + }); + return requestWithDefaults(options); + } + + if (decorations.renamed) { + const [newScope, newMethodName] = decorations.renamed; + octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`); + } + + if (decorations.deprecated) { + octokit.log.warn(decorations.deprecated); + } + + if (decorations.renamedParameters) { + // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + const options = requestWithDefaults.endpoint.merge(...args); + + 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`); + + if (!(alias in options)) { + options[alias] = options[name]; + } + + delete options[name]; + } + } + + return requestWithDefaults(options); + } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 + + + return requestWithDefaults(...args); + } + + return Object.assign(withDecorations, requestWithDefaults); +} + +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; + +exports.legacyRestEndpointMethods = legacyRestEndpointMethods; +exports.restEndpointMethods = restEndpointMethods; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 40937: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AdapterError = void 0; +var AdapterError = /** @class */ (function () { + function AdapterError(code, message) { + this.code = code; + this.message = message; + } + return AdapterError; +}()); +exports.AdapterError = AdapterError; + + +/***/ }), + +/***/ 49018: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AxiosAdapter = void 0; +var axios_1 = __importDefault(__nccwpck_require__(96545)); +var adapter_1 = __nccwpck_require__(40937); +var AxiosAdapter = /** @class */ (function () { + function AxiosAdapter() { + } + AxiosAdapter.prototype.execute = function (options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function () { + function formatError(response) { + if (!response.data) { + return undefined; + } + var message = response.data.ErrorMessage; + if (response.data.Errors) { + var errors = response.data.Errors; + for (var i = 0; i < errors.length; i++) { + message += "\n".concat(errors[i]); + } + } + return message; + } + var config, response, error_1; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + _c.trys.push([0, 2, , 3]); + config = { + httpsAgent: options.configuration.agent, + url: options.url, + method: options.method, + data: options.requestBody, + headers: { + "X-Octopus-ApiKey": (_a = options.configuration.apiKey) !== null && _a !== void 0 ? _a : "", + }, + responseType: "json", + }; + if (typeof XMLHttpRequest === "undefined") { + if (config.headers) { + config.headers["User-Agent"] = "ts-octopusdeploy"; + } + } + return [4 /*yield*/, axios_1.default.request(config)]; + case 1: + response = _c.sent(); + return [2 /*return*/, { + data: response.data, + statusCode: response.status, + }]; + case 2: + error_1 = _c.sent(); + if (axios_1.default.isAxiosError(error_1) && error_1.response) { + throw new adapter_1.AdapterError(error_1.response.status, (_b = formatError(error_1.response)) !== null && _b !== void 0 ? _b : error_1.message); + } + else { + throw error_1; + } + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + return AxiosAdapter; +}()); +exports.AxiosAdapter = AxiosAdapter; + + +/***/ }), + +/***/ 51542: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +var message_contracts_1 = __nccwpck_require__(74561); +var adapter_1 = __nccwpck_require__(40937); +var axiosAdapter_1 = __nccwpck_require__(49018); +var ApiClient = /** @class */ (function () { + function ApiClient(options) { + var _this = this; + this.handleSuccess = function (response) { + if (_this.options.onResponseCallback) { + var details = { + method: _this.options.method, + url: _this.options.url, + statusCode: response.statusCode, + }; + _this.options.onResponseCallback(details); + } + var responseText = ""; + if (_this.options.raw) { + responseText = response.data; + } + else { + responseText = JSON.stringify(response.data); + if (responseText && responseText.length > 0) { + responseText = JSON.parse(responseText); + } + } + _this.options.success(responseText); + }; + this.handleError = function (requestError) { + var err = generateOctopusError(requestError); + if (_this.options.onErrorResponseCallback) { + var details = { + method: _this.options.method, + url: _this.options.url, + statusCode: err.StatusCode, + errorMessage: err.ErrorMessage, + errors: err.Errors, + }; + _this.options.onErrorResponseCallback(details); + } + _this.options.error(err); + }; + this.options = options; + this.adapter = new axiosAdapter_1.AxiosAdapter(); + } + ApiClient.prototype.execute = function () { + return __awaiter(this, void 0, void 0, function () { + var response, error_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, this.adapter.execute(this.options)]; + case 1: + response = _a.sent(); + this.handleSuccess(response); + return [3 /*break*/, 3]; + case 2: + error_1 = _a.sent(); + if (error_1 instanceof adapter_1.AdapterError) { + this.handleError(error_1); + } + else if (error_1 instanceof Error) { + this.options.error(error_1); + } + else { + this.options.error(Error("An unknown error occurred: ".concat(error_1))); + } + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + return ApiClient; +}()); +exports["default"] = ApiClient; +var deserialize = function (responseText, raw, forceJson) { + if (forceJson === void 0) { forceJson = false; } + if (raw && !forceJson) + return responseText; + if (responseText && responseText.length) + return JSON.parse(responseText); + return null; +}; +var generateOctopusError = function (requestError) { + if (requestError.code) { + var code = requestError.code; + return new message_contracts_1.OctopusError(code, requestError.message); + } + return new message_contracts_1.OctopusError(0, requestError.message); +}; + + +/***/ }), + +/***/ 63024: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/init-declarations */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +var MAX_MEMORY = (Math.pow(1024, 2) * 1000) / 2; //1GB /2 (1 character in js is 2 bytes) +var Caching = /** @class */ (function () { + function Caching(options) { + this.cache = {}; + options = options || { + maxMemory: MAX_MEMORY, + }; + this.maxMemory = options.maxMemory; + this.dataVersionHeader = "X-Octopus-Data-Version"; + this.authorizationHashHeader = "X-Octopus-Authorization-Hash"; + } + Caching.prototype.clearAll = function () { + this.cache = {}; + }; + Caching.prototype.setHeaderAndGetValue = function (request, options) { + if (this.cache[options.url]) { + request.setRequestHeader(this.dataVersionHeader, this.cache[options.url].dataVersion); + request.setRequestHeader(this.authorizationHashHeader, this.cache[options.url].authorizationHash); + this.cache[options.url].lastAccessed = new Date(); + return this.cache[options.url].value; + } + }; + Caching.prototype.updateCache = function (request, options) { + try { + var dataVersion = request.getResponseHeader(this.dataVersionHeader); + var authorizationHash = request.getResponseHeader(this.authorizationHashHeader); + if (!!dataVersion && !!authorizationHash) { + var item = { + dataVersion: dataVersion, + authorizationHash: authorizationHash, + lastAccessed: new Date(), + value: request.responseText, + }; + var itemSize = this.itemSizeInMemory(options.url, item); + if (itemSize < this.maxMemory) { + this.cache[options.url] = item; + } + this.memoryPressureCleanup(); + } + else { + delete this.cache[options.url]; + } + } + catch (e) { + delete this.cache[options.url]; + } + }; + Caching.prototype.canUseCachedValue = function (request) { + return request.status === 304 && (request.responseText === "" || !request.responseText); + }; + Caching.prototype.memoryPressureCleanup = function () { + var currentMemory = this.roughSizeOfReleasableMemory(); + while (currentMemory >= this.maxMemory) { + this.removeOldest(); + var newMemoryLevel = this.roughSizeOfReleasableMemory(); + if (newMemoryLevel === currentMemory) { + // Just make sure we don't get stuck. + return; + } + currentMemory = newMemoryLevel; + } + }; + Caching.prototype.itemSizeInMemory = function (url, item) { + return url.length + item.value.length; + }; + Caching.prototype.removeOldest = function () { + var _this = this; + var oldestUrl; + var oldestResponded = -1; + var now = new Date(); + Object.keys(this.cache).forEach(function (url) { + var age = now.valueOf() - _this.cache[url].lastAccessed.valueOf(); + if (age > oldestResponded) { + oldestResponded = age; + oldestUrl = url; + } + }); + delete this.cache[oldestUrl]; + }; + Caching.prototype.roughSizeOfReleasableMemory = function () { + var _this = this; + return Object.keys(this.cache).reduce(function (total, url) { + var item = _this.cache[url]; + return total + _this.itemSizeInMemory(url, item); + }, 0); + }; + return Caching; +}()); +exports["default"] = Caching; + + +/***/ }), + +/***/ 42399: +/***/ (function(__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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Client = void 0; +var apiClient_1 = __importDefault(__nccwpck_require__(51542)); +var clientConfiguration_1 = __nccwpck_require__(5966); +var environment_1 = __importDefault(__nccwpck_require__(96050)); +var resolver_1 = __nccwpck_require__(28043); +var subscriptionRecord_1 = __nccwpck_require__(31547); +var apiLocation = "~/api"; +// The Octopus Client implements the low-level semantics of the Octopus Deploy REST API +var Client = /** @class */ (function () { + function Client(session, resolver, rootDocument, spaceId, spaceRootDocument, configuration) { + var _this = this; + this.session = session; + this.resolver = resolver; + this.rootDocument = rootDocument; + this.spaceId = spaceId; + this.spaceRootDocument = spaceRootDocument; + this.configuration = configuration; + this.requestSubscriptions = new subscriptionRecord_1.SubscriptionRecord(); + this.responseSubscriptions = new subscriptionRecord_1.SubscriptionRecord(); + this.errorSubscriptions = new subscriptionRecord_1.SubscriptionRecord(); + this.onRequestCallback = undefined; + this.onResponseCallback = undefined; + this.onErrorResponseCallback = undefined; + this.debug = function (message) { + _this.logger.debug && _this.logger.debug(message); + }; + this.info = function (message) { + _this.logger.info && _this.logger.info(message); + }; + this.warn = function (message) { + _this.logger.warn && _this.logger.warn(message); + }; + this.error = function (message, error) { + if (error === void 0) { error = undefined; } + _this.logger.error && _this.logger.error(message, error); + }; + this.subscribeToRequests = function (registrationName, callback) { + return _this.requestSubscriptions.subscribe(registrationName, callback); + }; + this.subscribeToResponses = function (registrationName, callback) { + return _this.responseSubscriptions.subscribe(registrationName, callback); + }; + this.subscribeToErrors = function (registrationName, callback) { + return _this.errorSubscriptions.subscribe(registrationName, callback); + }; + this.setOnRequestCallback = function (callback) { + _this.onRequestCallback = callback; + }; + this.setOnResponseCallback = function (callback) { + _this.onResponseCallback = callback; + }; + this.setOnErrorResponseCallback = function (callback) { + _this.onErrorResponseCallback = callback; + }; + this.resolve = function (path, uriTemplateParameters) { return _this.resolver.resolve(path, uriTemplateParameters); }; + this.configuration = configuration; + this.logger = __assign({ + debug: function (message) { return console.debug(message); }, + info: function (message) { return console.info(message); }, + warn: function (message) { return console.warn(message); }, + error: function (message, err) { + if (err !== undefined) { + console.error(err.message); + } + else { + console.error(message); + } + }, + }, configuration.logging); + this.resolver = resolver; + this.rootDocument = rootDocument; + this.spaceRootDocument = spaceRootDocument; + } + Client.create = function (configuration) { + return __awaiter(this, void 0, void 0, function () { + var resolver, client, error_1, error_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + configuration = (0, clientConfiguration_1.processConfiguration)(configuration); + if (!configuration.apiUri) { + throw new Error("The host is not specified"); + } + resolver = new resolver_1.Resolver(configuration.apiUri); + client = new Client(null, resolver, null, null, null, configuration); + if (!configuration.autoConnect) return [3 /*break*/, 8]; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, client.connect(function (message, error) { + client.debug("Attempting to connect to API endpoint..."); + })]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + error_1 = _a.sent(); + if (error_1 instanceof Error) + client.error("Could not connect", error_1); + throw error_1; + case 4: + if (!(configuration.space !== undefined && configuration.space !== "")) return [3 /*break*/, 8]; + _a.label = 5; + case 5: + _a.trys.push([5, 7, , 8]); + return [4 /*yield*/, client.switchToSpace(configuration.space)]; + case 6: + _a.sent(); + return [3 /*break*/, 8]; + case 7: + error_2 = _a.sent(); + if (error_2 instanceof Error) + client.error("Could not switch to space", error_2); + throw error_2; + case 8: return [2 /*return*/, client]; + } + }); + }); + }; + Client.prototype.connect = function (progressCallback) { + var _this = this; + progressCallback("Checking credentials..."); + return new Promise(function (resolve, reject) { + if (_this.rootDocument) { + resolve(); + return; + } + var attempt = function (success, fail) { + _this.get(apiLocation).then(function (root) { + success(root); + }, fail); + }; + var onSuccess = function (root) { + _this.rootDocument = root; + resolve(); + }; + var onFail = function (err) { + progressCallback("Unable to connect.", err); + reject(err); + }; + attempt(onSuccess, onFail); + }); + }; + Client.prototype.disconnect = function () { + this.rootDocument = null; + this.spaceId = null; + this.spaceRootDocument = null; + }; + Client.prototype.forSpace = function (spaceId) { + return __awaiter(this, void 0, void 0, function () { + var spaceRootResource; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.get(this.rootDocument.Links["SpaceHome"], { spaceId: spaceId })]; + case 1: + spaceRootResource = _a.sent(); + return [2 /*return*/, new Client(this.session, this.resolver, this.rootDocument, spaceId, spaceRootResource, this.configuration)]; + } + }); + }); + }; + Client.prototype.forSystem = function () { + return new Client(this.session, this.resolver, this.rootDocument, null, null, this.configuration); + }; + Client.prototype.switchToSpace = function (spaceIdOrName) { + return __awaiter(this, void 0, void 0, function () { + var spaceList, uppercaseSpaceIdOrName, spaceResources, spaceResource, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (this.rootDocument === null) { + throw new Error("Root document is null; this document is required for the API client. Please ensure that the API endpoint is accessible along with its root document."); + } + return [4 /*yield*/, this.get(this.rootDocument.Links["Spaces"])]; + case 1: + spaceList = _b.sent(); + uppercaseSpaceIdOrName = spaceIdOrName.toUpperCase(); + spaceResources = spaceList.Items.filter(function (s) { return s.Name.toUpperCase() === uppercaseSpaceIdOrName || s.Id.toUpperCase() === uppercaseSpaceIdOrName; }); + if (!(spaceResources.length == 1)) return [3 /*break*/, 3]; + spaceResource = spaceResources[0]; + this.spaceId = spaceResource.Id; + _a = this; + return [4 /*yield*/, this.get(spaceResource.Links["SpaceHome"])]; + case 2: + _a.spaceRootDocument = _b.sent(); + return [2 /*return*/]; + case 3: throw new Error("Unable to uniquely identify a space using '".concat(spaceIdOrName, "'.")); + } + }); + }); + }; + Client.prototype.switchToSystem = function () { + this.spaceId = null; + this.spaceRootDocument = null; + }; + Client.prototype.get = function (path, args) { + if (path === undefined) + return {}; + var url = this.resolveUrlWithSpaceId(path, args); + return this.dispatchRequest("GET", url); + }; + Client.prototype.getRaw = function (path, args) { + var _this = this; + var url = this.resolve(path, args); + return new Promise(function (resolve, reject) { + new apiClient_1.default({ + configuration: _this.configuration, + session: _this.session, + url: url, + method: "GET", + error: function (e) { return reject(e); }, + raw: true, + success: function (data) { return resolve(data); }, + tryGetServerInformation: function () { return _this.tryGetServerInformation(); }, + getAntiForgeryTokenCallback: function () { return _this.getAntiforgeryToken(); }, + onRequestCallback: function (r) { return _this.onRequest(r); }, + onResponseCallback: function (r) { return _this.onResponse(r); }, + onErrorResponseCallback: function (r) { return _this.onErrorResponse(r); }, + }).execute(); + }); + }; + Client.prototype.onRequest = function (clientRequestDetails) { + var details = { + url: clientRequestDetails.url, + method: clientRequestDetails.method, + }; + if (this.onRequestCallback) { + this.onRequestCallback(details); + } + this.requestSubscriptions.notifyAll(details); + }; + Client.prototype.onResponse = function (clientResponseDetails) { + var details = { + url: clientResponseDetails.url, + method: clientResponseDetails.method, + statusCode: clientResponseDetails.statusCode, + }; + if (this.onResponseCallback) { + this.onResponseCallback(details); + } + this.responseSubscriptions.notifyAll(details); + }; + Client.prototype.onErrorResponse = function (clientErrorResponseDetails) { + var details = { + url: clientErrorResponseDetails.url, + method: clientErrorResponseDetails.method, + statusCode: clientErrorResponseDetails.statusCode, + errorMessage: clientErrorResponseDetails.errorMessage, + errors: clientErrorResponseDetails.errors, + }; + if (this.onErrorResponseCallback) { + this.onErrorResponseCallback(details); + } + this.errorSubscriptions.notifyAll(details); + }; + Client.prototype.post = function (path, resource, args) { + var url = this.resolveUrlWithSpaceId(path, args); + return this.dispatchRequest("POST", url, resource); + }; + Client.prototype.create = function (path, resource, args) { + var _this = this; + var url = this.resolve(path, args); + return new Promise(function (resolve, reject) { + _this.dispatchRequest("POST", url, resource).then(function (result) { + var _a; + var selfLink = (_a = result.Links) === null || _a === void 0 ? void 0 : _a.Self; + if (selfLink) { + var result2 = _this.get(selfLink); + resolve(result2); + return; + } + resolve(result); + }, reject); + }); + }; + Client.prototype.update = function (path, resource, args) { + var _this = this; + var url = this.resolve(path, args); + return new Promise(function (resolve, reject) { + _this.dispatchRequest("PUT", url, resource).then(function (result) { + var _a; + var selfLink = (_a = result.Links) === null || _a === void 0 ? void 0 : _a.Self; + if (selfLink) { + var result2 = _this.get(selfLink); + resolve(result2); + return; + } + resolve(result); + }, reject); + }); + }; + Client.prototype.del = function (path, resource, args) { + var url = this.resolve(path, args); + return this.dispatchRequest("DELETE", url, resource); + }; + Client.prototype.put = function (path, resource, args) { + var url = this.resolveUrlWithSpaceId(path, args); + return this.dispatchRequest("PUT", url, resource); + }; + Client.prototype.getAntiforgeryToken = function () { + if (!this.isConnected()) { + return null; + } + var installationId = this.getGlobalRootDocument().InstallationId; + if (!installationId) { + return null; + } + // If we have come this far we know we are on a version of Octopus Server which supports anti-forgery tokens + var antiforgeryCookieName = "Octopus-Csrf-Token_" + installationId; + var antiforgeryCookies = document.cookie + .split(";") + .filter(function (c) { + return c.trim().indexOf(antiforgeryCookieName) === 0; + }) + .map(function (c) { + return c.trim(); + }); + if (antiforgeryCookies && antiforgeryCookies.length === 1) { + var antiforgeryToken = antiforgeryCookies[0].split("=")[1]; + return antiforgeryToken; + } + else { + if (environment_1.default.isInDevelopmentMode()) { + return "FAKE TOKEN USED FOR DEVELOPMENT"; + } + return null; + } + }; + Client.prototype.resolveLinkTemplate = function (link, args) { + return this.resolve(this.getLink(link), args); + }; + Client.prototype.getServerInformation = function () { + if (!this.isConnected()) { + throw new Error("The Octopus Client has not connected. THIS SHOULD NOT HAPPEN! Please notify support."); + } + return { + version: this.rootDocument.Version, + }; + }; + Client.prototype.tryGetServerInformation = function () { + return this.rootDocument + ? { + version: this.rootDocument.Version, + installationId: this.rootDocument.InstallationId, + } + : null; + }; + Client.prototype.throwIfClientNotConnected = function () { + if (!this.isConnected()) { + var errorMessage = "Can't get the link from the client, because the client has not yet been connected."; + throw new Error(errorMessage); + } + }; + Client.prototype.getSystemLink = function (linkGetter) { + this.throwIfClientNotConnected(); + var link = linkGetter(this.rootDocument.Links); + if (link === null) { + var errorMessage = "Can't get the link for ".concat(name, " from the client, because it could not be found in the root document."); + throw new Error(errorMessage); + } + return link; + }; + Client.prototype.getLink = function (name) { + this.throwIfClientNotConnected(); + var spaceLinkExists = this.spaceRootDocument && this.spaceRootDocument.Links !== undefined && this.spaceRootDocument.Links[name]; + var link = spaceLinkExists ? this.spaceRootDocument.Links[name] : this.rootDocument.Links[name]; + if (!link) { + var errorMessage = "Can't get the link for ".concat(name, " from the client, because it could not be found in the root document or the space root document."); + throw new Error(errorMessage); + } + return link; + }; + Client.prototype.dispatchRequest = function (method, url, requestBody) { + var _this = this; + return new Promise(function (resolve, reject) { + new apiClient_1.default({ + configuration: _this.configuration, + session: _this.session, + error: function (e) { return reject(e); }, + method: method, + url: url, + requestBody: requestBody, + success: function (data) { return resolve(data); }, + tryGetServerInformation: function () { return _this.tryGetServerInformation(); }, + getAntiForgeryTokenCallback: function () { return _this.getAntiforgeryToken(); }, + onRequestCallback: function (r) { return _this.onRequest(r); }, + onResponseCallback: function (r) { return _this.onResponse(r); }, + onErrorResponseCallback: function (r) { return _this.onErrorResponse(r); }, + }).execute(); + }); + }; + Client.prototype.isConnected = function () { + return this.rootDocument !== null; + }; + Client.prototype.getArgsWithSpaceId = function (args) { + return this.spaceId ? __assign({ spaceId: this.spaceId }, args) : args; + }; + Client.prototype.getGlobalRootDocument = function () { + if (!this.isConnected()) { + throw new Error("The Octopus Client has not connected."); + } + return this.rootDocument; + }; + Client.prototype.resolveUrlWithSpaceId = function (path, args) { + return this.resolve(path, this.getArgsWithSpaceId(args)); + }; + return Client; +}()); +exports.Client = Client; + + +/***/ }), + +/***/ 5966: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.processConfiguration = void 0; +var environmentVariables_1 = __nccwpck_require__(48583); +function processConfiguration(configuration) { + var apiKey = process.env[environmentVariables_1.EnvironmentVariables.ApiKey] || ""; + var host = process.env[environmentVariables_1.EnvironmentVariables.Host] || ""; + var space = process.env[environmentVariables_1.EnvironmentVariables.Space] || ""; + if (!configuration) { + return { + apiKey: apiKey, + apiUri: host, + autoConnect: true, + space: space, + }; + } + return { + apiKey: !configuration.apiKey || configuration.apiKey.length === 0 ? apiKey : configuration.apiKey, + apiUri: !configuration.apiUri || configuration.apiUri.length === 0 ? host : configuration.apiUri, + autoConnect: configuration.autoConnect === undefined ? true : configuration.autoConnect, + space: !configuration.space || configuration.space.length === 0 ? space : configuration.space, + }; +} +exports.processConfiguration = processConfiguration; + + +/***/ }), + +/***/ 92101: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 57948: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 16397: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 35758: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 45953: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ClientSession = void 0; +var ClientSession = /** @class */ (function () { + function ClientSession(cache, isAuthenticated, endSession) { + var _this = this; + this.cache = cache; + this.isAuthenticated = isAuthenticated; + this.endSession = endSession; + this.end = function () { + _this.endSession(); + _this.cache.clearAll(); + }; + } + return ClientSession; +}()); +exports.ClientSession = ClientSession; + + +/***/ }), + +/***/ 96050: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +var Environment = /** @class */ (function () { + function Environment() { + } + Environment.isInDevelopmentMode = function () { + return !process.env.NODE_ENV || process.env.NODE_ENV !== "production"; + }; + return Environment; +}()); +exports["default"] = Environment; + + +/***/ }), + +/***/ 48583: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EnvironmentVariables = void 0; +exports.EnvironmentVariables = { + ApiKey: "OCTOPUS_API_KEY", + Host: "OCTOPUS_HOST", + Proxy: "OCTOPUS_PROXY", + ProxyPassword: "OCTOPUS_PROXY_PASSWORD", + ProxyUsername: "OCTOPUS_PROXY_USERNAME", + Space: "OCTOPUS_SPACE", +}; + + +/***/ }), + +/***/ 30661: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 80586: +/***/ (function(__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; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(51542), exports); +__exportStar(__nccwpck_require__(63024), exports); +__exportStar(__nccwpck_require__(42399), exports); +__exportStar(__nccwpck_require__(5966), exports); +__exportStar(__nccwpck_require__(92101), exports); +__exportStar(__nccwpck_require__(57948), exports); +__exportStar(__nccwpck_require__(16397), exports); +__exportStar(__nccwpck_require__(35758), exports); +__exportStar(__nccwpck_require__(45953), exports); +__exportStar(__nccwpck_require__(96050), exports); +__exportStar(__nccwpck_require__(48583), exports); +__exportStar(__nccwpck_require__(30661), exports); +__exportStar(__nccwpck_require__(5924), exports); +__exportStar(__nccwpck_require__(77085), exports); +__exportStar(__nccwpck_require__(9507), exports); +__exportStar(__nccwpck_require__(67895), exports); +__exportStar(__nccwpck_require__(89463), exports); +__exportStar(__nccwpck_require__(42583), exports); +__exportStar(__nccwpck_require__(15835), exports); +__exportStar(__nccwpck_require__(7946), exports); +__exportStar(__nccwpck_require__(4776), exports); +__exportStar(__nccwpck_require__(41266), exports); +__exportStar(__nccwpck_require__(94659), exports); +__exportStar(__nccwpck_require__(94203), exports); +__exportStar(__nccwpck_require__(69039), exports); +__exportStar(__nccwpck_require__(13497), exports); +__exportStar(__nccwpck_require__(66446), exports); +__exportStar(__nccwpck_require__(20009), exports); +__exportStar(__nccwpck_require__(81630), exports); +__exportStar(__nccwpck_require__(82773), exports); +__exportStar(__nccwpck_require__(91848), exports); +__exportStar(__nccwpck_require__(98936), exports); +__exportStar(__nccwpck_require__(27848), exports); +__exportStar(__nccwpck_require__(8183), exports); +__exportStar(__nccwpck_require__(65269), exports); +__exportStar(__nccwpck_require__(22999), exports); +__exportStar(__nccwpck_require__(4387), exports); +__exportStar(__nccwpck_require__(55459), exports); +__exportStar(__nccwpck_require__(56116), exports); +__exportStar(__nccwpck_require__(20037), exports); +__exportStar(__nccwpck_require__(18029), exports); +__exportStar(__nccwpck_require__(90977), exports); +__exportStar(__nccwpck_require__(15228), exports); +__exportStar(__nccwpck_require__(78681), exports); +__exportStar(__nccwpck_require__(64693), exports); +__exportStar(__nccwpck_require__(51916), exports); +__exportStar(__nccwpck_require__(56946), exports); +__exportStar(__nccwpck_require__(3522), exports); +__exportStar(__nccwpck_require__(154), exports); +__exportStar(__nccwpck_require__(53015), exports); +__exportStar(__nccwpck_require__(50197), exports); +__exportStar(__nccwpck_require__(1939), exports); +__exportStar(__nccwpck_require__(94772), exports); +__exportStar(__nccwpck_require__(80891), exports); +__exportStar(__nccwpck_require__(34819), exports); +__exportStar(__nccwpck_require__(53378), exports); +__exportStar(__nccwpck_require__(21797), exports); +__exportStar(__nccwpck_require__(97886), exports); +__exportStar(__nccwpck_require__(53127), exports); +// export * from "./repositories/projectContextRepository"; +__exportStar(__nccwpck_require__(38331), exports); +__exportStar(__nccwpck_require__(52058), exports); +__exportStar(__nccwpck_require__(91795), exports); +__exportStar(__nccwpck_require__(57502), exports); +__exportStar(__nccwpck_require__(7358), exports); +__exportStar(__nccwpck_require__(87252), exports); +__exportStar(__nccwpck_require__(11050), exports); +__exportStar(__nccwpck_require__(82404), exports); +__exportStar(__nccwpck_require__(18312), exports); +__exportStar(__nccwpck_require__(30242), exports); +__exportStar(__nccwpck_require__(73544), exports); +__exportStar(__nccwpck_require__(63767), exports); +__exportStar(__nccwpck_require__(18774), exports); +__exportStar(__nccwpck_require__(96489), exports); +__exportStar(__nccwpck_require__(84463), exports); +__exportStar(__nccwpck_require__(50924), exports); +__exportStar(__nccwpck_require__(7025), exports); +__exportStar(__nccwpck_require__(56836), exports); +__exportStar(__nccwpck_require__(94178), exports); +__exportStar(__nccwpck_require__(50450), exports); +__exportStar(__nccwpck_require__(53573), exports); +__exportStar(__nccwpck_require__(30986), exports); +__exportStar(__nccwpck_require__(66168), exports); +__exportStar(__nccwpck_require__(54198), exports); +__exportStar(__nccwpck_require__(19652), exports); +__exportStar(__nccwpck_require__(99284), exports); +__exportStar(__nccwpck_require__(67597), exports); +__exportStar(__nccwpck_require__(41025), exports); +__exportStar(__nccwpck_require__(27747), exports); +__exportStar(__nccwpck_require__(10895), exports); +__exportStar(__nccwpck_require__(74126), exports); +__exportStar(__nccwpck_require__(72887), exports); +__exportStar(__nccwpck_require__(50210), exports); +__exportStar(__nccwpck_require__(65737), exports); +__exportStar(__nccwpck_require__(91616), exports); +__exportStar(__nccwpck_require__(43399), exports); +__exportStar(__nccwpck_require__(871), exports); +__exportStar(__nccwpck_require__(15435), exports); +__exportStar(__nccwpck_require__(28043), exports); +__exportStar(__nccwpck_require__(82138), exports); +__exportStar(__nccwpck_require__(60232), exports); +__exportStar(__nccwpck_require__(445), exports); +__exportStar(__nccwpck_require__(31547), exports); +__exportStar(__nccwpck_require__(54663), exports); +__exportStar(__nccwpck_require__(47132), exports); + + +/***/ }), + +/***/ 5924: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 46890: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.connect = void 0; +var client_1 = __nccwpck_require__(42399); +var repository_1 = __nccwpck_require__(871); +function connect(space) { + return __awaiter(this, void 0, void 0, function () { + var client, repository; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, client_1.Client.create()]; + case 1: + client = _a.sent(); + if (client === undefined) { + throw new Error("The API client failed initialize"); + } + return [4 /*yield*/, new repository_1.Repository(client).forSpace(space)]; + case 2: + repository = _a.sent(); + return [2 /*return*/, [repository, client]]; + } + }); + }); +} +exports.connect = connect; + + +/***/ }), + +/***/ 62407: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CouldNotFindError = void 0; +var CouldNotFindError = /** @class */ (function (_super) { + __extends(CouldNotFindError, _super); + function CouldNotFindError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, CouldNotFindError.prototype); + return _this; + } + CouldNotFindError.createWhat = function (what, quotedName) { + if (quotedName === void 0) { quotedName = null; } + var message = quotedName === null ? what : "".concat(what, " '").concat(quotedName, "'"); + var e = new CouldNotFindError("Could not find ".concat(message, "; either it does not exist or you lack permissions to view it.")); + return e; + }; + CouldNotFindError.createResource = function (resourceTypeDisplayName, nameOrId, enclosingContextDescription) { + if (enclosingContextDescription === void 0) { enclosingContextDescription = ""; } + return CouldNotFindError.createWhat("Cannot find the ".concat(resourceTypeDisplayName, " with name or id '").concat(nameOrId, "'").concat(enclosingContextDescription, ". Please check the spelling and that you have permissions to view it. Please use Configuration > Test Permissions to confirm.")); + }; + return CouldNotFindError; +}(Error)); +exports.CouldNotFindError = CouldNotFindError; + + +/***/ }), + +/***/ 27379: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ChannelVersionRuleTestResult = exports.ChannelVersionRuleTester = void 0; +var semver_1 = __nccwpck_require__(11383); +var ChannelVersionRuleTester = /** @class */ (function () { + function ChannelVersionRuleTester(client) { + this.client = client; + } + ChannelVersionRuleTester.prototype.test = function (rule, packageVersion, feedId) { + var _a; + return __awaiter(this, void 0, void 0, function () { + var link, resource, version; + return __generator(this, function (_b) { + if (rule === undefined) + // Anything goes if there is no rule defined for this step + return [2 /*return*/, ChannelVersionRuleTestResult.Null()]; + if (!packageVersion) + // If we don't have a package version, this rule should be ignored + return [2 /*return*/, ChannelVersionRuleTestResult.Failed()]; + link = this.client.getLink('VersionRuleTest'); + resource = { + version: packageVersion, + versionRange: rule.VersionRange, + preReleaseTag: rule.Tag, + feedId: feedId + }; + version = (_a = this.client.tryGetServerInformation()) === null || _a === void 0 ? void 0 : _a.version; + if (version !== undefined && new semver_1.SemVer(version) > new semver_1.SemVer('2021.2')) { + return [2 /*return*/, this.client.post(link, resource)]; + } + return [2 /*return*/, this.client.get(link, resource)]; + }); + }); + }; + return ChannelVersionRuleTester; +}()); +exports.ChannelVersionRuleTester = ChannelVersionRuleTester; +var Pass = 'PASS'; +var Fail = 'FAIL'; +var ChannelVersionRuleTestResult = /** @class */ (function () { + function ChannelVersionRuleTestResult() { + this.satisfiesVersionRange = false; + this.satisfiesPreReleaseTag = false; + this.isNull = false; + } + Object.defineProperty(ChannelVersionRuleTestResult.prototype, "isSatisfied", { + get: function () { + return this.satisfiesVersionRange && this.satisfiesPreReleaseTag; + }, + enumerable: false, + configurable: true + }); + ChannelVersionRuleTestResult.prototype.toSummaryString = function () { + return this.isNull + ? 'Allow any version' + : "Range: ".concat(this.satisfiesVersionRange ? Pass : Fail, " Tag: ").concat(this.satisfiesPreReleaseTag ? Pass : Fail); + }; + ChannelVersionRuleTestResult.Failed = function () { + return new ChannelVersionRuleTestResult(); + }; + ChannelVersionRuleTestResult.Null = function () { + var channelVersionRuleTestResult = new ChannelVersionRuleTestResult(); + channelVersionRuleTestResult.isNull = true; + channelVersionRuleTestResult.satisfiesVersionRange = true; + channelVersionRuleTestResult.satisfiesPreReleaseTag = true; + return channelVersionRuleTestResult; + }; + return ChannelVersionRuleTestResult; +}()); +exports.ChannelVersionRuleTestResult = ChannelVersionRuleTestResult; + + +/***/ }), + +/***/ 77948: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createRelease = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var clientConfiguration_1 = __nccwpck_require__(5966); +var deployment_base_1 = __nccwpck_require__(5548); +var throw_if_undefined_1 = __nccwpck_require__(70347); +var channel_version_rule_tester_1 = __nccwpck_require__(27379); +var package_version_resolver_1 = __nccwpck_require__(89489); +var release_plan_builder_1 = __nccwpck_require__(43817); +function releaseOptionsDefaults() { + return { + ignoreChannelRules: false, + ignoreExisting: false, + packages: [], + whatIf: false, + }; +} +function createRelease(repository, project, releaseOptions, deploymentOptions) { + return __awaiter(this, void 0, void 0, function () { + var proj, configuration; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, repository.projects.find(nameOrId)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, repository.projects.get(id)]; + }); }); }, "Projects", "project", project.Name)]; + case 1: + proj = _a.sent(); + configuration = (0, clientConfiguration_1.processConfiguration)(); + console.log("Creating a release..."); + return [4 /*yield*/, new CreateRelease(repository, configuration.apiUri, proj, releaseOptions, deploymentOptions).execute()]; + case 2: + _a.sent(); + console.log("Release created successfully."); + return [2 /*return*/]; + } + }); + }); +} +exports.createRelease = createRelease; +var CreateRelease = /** @class */ (function (_super) { + __extends(CreateRelease, _super); + function CreateRelease(repository, serverUrl, project, releaseOptions, deploymentOptions) { + var _this = _super.call(this, repository, serverUrl, deploymentOptions) || this; + _this.project = project; + _this.releaseOptions = __assign(__assign({}, releaseOptionsDefaults()), releaseOptions); + _this.packageVersionResolver = new package_version_resolver_1.PackageVersionResolver(); + _this.releasePlanBuilder = new release_plan_builder_1.ReleasePlanBuilder(repository.client, _this.packageVersionResolver, new channel_version_rule_tester_1.ChannelVersionRuleTester(repository.client)); + return _this; + } + CreateRelease.prototype.releaseNotesFallBackToDeploymentSettings = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + if (this.releaseOptions.releaseNotes) + return [2 /*return*/]; + return [2 /*return*/]; + }); + }); + }; + CreateRelease.prototype.execute = function () { + var _a, _b, _c, _d, _e; + return __awaiter(this, void 0, void 0, function () { + var _i, _f, pkg, plan, found, _g, releaseResource, release; + return __generator(this, function (_h) { + switch (_h.label) { + case 0: + this.validateProjectPersistenceRequirements(); + if (this.releaseOptions.defaultPackageVersion != undefined) { + this.packageVersionResolver.setDefault(this.releaseOptions.defaultPackageVersion); + } + if (!(this.releaseOptions.packagesFolder != undefined)) return [3 /*break*/, 2]; + return [4 /*yield*/, this.packageVersionResolver.addFolder(this.releaseOptions.packagesFolder)]; + case 1: + _h.sent(); + _h.label = 2; + case 2: + _i = 0, _f = this.releaseOptions.packages; + _h.label = 3; + case 3: + if (!(_i < _f.length)) return [3 /*break*/, 6]; + pkg = _f[_i]; + return [4 /*yield*/, this.packageVersionResolver.addPackage(pkg.id, pkg.version)]; + case 4: + _h.sent(); + _h.label = 5; + case 5: + _i++; + return [3 /*break*/, 3]; + case 6: return [4 /*yield*/, this.buildReleasePlan()]; + case 7: + plan = _h.sent(); + if (!plan) + return [2 /*return*/]; + if (this.releaseOptions.releaseNumber) { + this.versionNumber = this.releaseOptions.releaseNumber; + console.debug("Using version number provided on command-line: ".concat(this.versionNumber)); + } + else if (plan.releaseTemplate.NextVersionIncrement) { + this.versionNumber = plan.releaseTemplate.NextVersionIncrement; + console.debug("Using version number from release template: ".concat(this.versionNumber)); + } + else if (plan.releaseTemplate.VersioningPackageStepName) { + this.versionNumber = plan.getActionVersionNumber(plan.releaseTemplate.VersioningPackageStepName, plan.releaseTemplate.VersioningPackageReferenceName); + console.debug("Using version number from package step: ".concat(this.versionNumber)); + } + else { + throw new Error("A version number was not specified and could not be automatically selected."); + } + if (plan.isViableReleasePlan()) { + console.info("Release plan for ".concat(this.project.Name, " ").concat(this.versionNumber)); + } + else { + console.warn("Release plan for ".concat(this.project.Name, " ").concat(this.versionNumber)); + } + if (plan.hasUnresolvedSteps()) + throw new Error("Package versions could not be resolved for one or more of the package packageSteps in this release. See the errors above for details. Either ensure the latest version of the package can be automatically resolved, or set the version to use specifically by using the --package argument."); + if (!plan.channelHasAnyEnabledSteps()) { + throw new Error("Channel ".concat((_a = plan.channel) === null || _a === void 0 ? void 0 : _a.Name, " has no available steps")); + } + if (plan.hasStepsViolatingChannelVersionRules()) { + if (this.releaseOptions.ignoreChannelRules) + console.warn("At least one step violates the package version rules for the Channel '".concat((_b = plan.channel) === null || _b === void 0 ? void 0 : _b.Name, "'. Forcing the release to be created ignoring these rules...")); + else + throw new Error("At least one step violates the package version rules for the Channel '".concat((_c = plan.channel) === null || _c === void 0 ? void 0 : _c.Name, "'. Either correct the package versions for this release, let Octopus select the best channel by omitting the --channel argument, select a different channel using --channel=MyChannel argument, or ignore these version rules altogether by using the --ignoreChannelRules argument.")); + } + if (!this.releaseOptions.ignoreExisting) return [3 /*break*/, 11]; + console.debug("Checking for existing release for ".concat(this.project.Name, " ").concat(this.versionNumber, " because you specified --ignoreExisting...")); + _h.label = 8; + case 8: + _h.trys.push([8, 10, , 11]); + return [4 /*yield*/, this.repository.projects.getReleaseByVersion(this.project, this.versionNumber)]; + case 9: + found = _h.sent(); + if (found !== undefined) { + console.info("A release of ".concat(this.project.Name, " with the number ").concat(this.versionNumber, " already exists, and you specified --ignoreExisting, so we won't even attempt to create the release.")); + return [2 /*return*/]; + } + return [3 /*break*/, 11]; + case 10: + _g = _h.sent(); + // Expected + console.debug("No release exists - the coast is clear!"); + return [3 /*break*/, 11]; + case 11: + if (!this.releaseOptions.whatIf) return [3 /*break*/, 12]; + // We were just doing a dry run - bail out here + if (this.deploymentOptions.deployTo.length > 0) + console.info("[WhatIf] This release would have been created using the release plan and deployed to ".concat(this.deploymentOptions.deployTo)); + else + console.info("[WhatIf] This release would have been created using the release plan"); + return [3 /*break*/, 16]; + case 12: + // Actually create the release! + console.debug("Creating release..."); + return [4 /*yield*/, this.releaseNotesFallBackToDeploymentSettings()]; + case 13: + _h.sent(); + releaseResource = { + ChannelId: (_d = plan.channel) === null || _d === void 0 ? void 0 : _d.Id, + ProjectId: this.project.Id, + SelectedPackages: plan.getSelections(), + Version: this.versionNumber, + }; + releaseResource.VersionControlReference = + this.project.PersistenceSettings.Type === message_contracts_1.PersistenceSettingsType.VersionControlled + ? { + GitRef: this.releaseOptions.gitRef, + GitCommit: this.releaseOptions.gitCommit, + } + : undefined; + return [4 /*yield*/, this.repository.releases.create(releaseResource, this.releaseOptions.ignoreChannelRules)]; + case 14: + release = _h.sent(); + console.info("Release ".concat(release.Version, " created successfully.")); + if ((_e = release.VersionControlReference) === null || _e === void 0 ? void 0 : _e.GitCommit) + console.info("Release created from commit ".concat(release.VersionControlReference.GitCommit, " of git reference ").concat(release.VersionControlReference.GitRef, ".")); + return [4 /*yield*/, this.deployRelease(this.project, release)]; + case 15: + _h.sent(); + _h.label = 16; + case 16: return [2 /*return*/]; + } + }); + }); + }; + CreateRelease.prototype.buildReleasePlan = function () { + return __awaiter(this, void 0, void 0, function () { + var matchingChannel; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.releaseOptions.channel) return [3 /*break*/, 3]; + console.info("Building release plan for channel '".concat(this.releaseOptions.channel.Name, "'...")); + return [4 /*yield*/, this.getMatchingChannel(this.releaseOptions.channel.Name)]; + case 1: + matchingChannel = _a.sent(); + return [4 /*yield*/, this.releasePlanBuilder.build(this.repository, this.project, matchingChannel, this.releaseOptions.packagePrerelease, this.releaseOptions.gitRef, this.releaseOptions.gitCommit)]; + case 2: return [2 /*return*/, _a.sent()]; + case 3: + console.debug("Automatically selecting the best channel for this release..."); + return [4 /*yield*/, this.autoSelectBestReleasePlanOrThrow()]; + case 4: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + CreateRelease.prototype.getChannel = function () { + var _a, _b; + return __awaiter(this, void 0, void 0, function () { + var branch; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + branch = undefined; + if ((0, message_contracts_1.HasVersionControlledPersistenceSettings)(this.project.PersistenceSettings)) { + branch = (_b = (_a = this.releaseOptions.gitCommit) !== null && _a !== void 0 ? _a : this.releaseOptions.gitRef) !== null && _b !== void 0 ? _b : this.project.PersistenceSettings.DefaultBranch; + } + return [4 /*yield*/, this.repository.projects.getChannels(this.project, branch, 0, this.repository.projects.takeAll)]; + case 1: return [2 /*return*/, _c.sent()]; + } + }); + }); + }; + CreateRelease.prototype.autoSelectBestReleasePlanOrThrow = function () { + var _a, _b; + return __awaiter(this, void 0, void 0, function () { + var channels, candidateChannels, releasePlans, _i, candidateChannels_1, channel, _c, viablePlans, selectedPlan, selectedPlan; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: return [4 /*yield*/, this.getChannel()]; + case 1: + channels = _d.sent(); + candidateChannels = channels.Items; + releasePlans = []; + _i = 0, candidateChannels_1 = candidateChannels; + _d.label = 2; + case 2: + if (!(_i < candidateChannels_1.length)) return [3 /*break*/, 5]; + channel = candidateChannels_1[_i]; + console.info("Building a release plan for channel, \"".concat(channel.Name, "\"...")); + _c = this; + return [4 /*yield*/, this.releasePlanBuilder.build(this.repository, this.project, channel, this.releaseOptions.packagePrerelease, this.releaseOptions.gitRef, this.releaseOptions.gitCommit)]; + case 3: + _c.plan = _d.sent(); + releasePlans.push(this.plan); + if (!this.plan.channelHasAnyEnabledSteps()) + console.warn("Channel, \"".concat(channel.Name, "\" does not have any enabled package steps.")); + _d.label = 4; + case 4: + _i++; + return [3 /*break*/, 2]; + case 5: + viablePlans = releasePlans.filter(function (p) { return p.isViableReleasePlan(); }); + if (viablePlans.length === 0) + throw new Error("There are no viable release plans in any channels using the provided arguments. The following release plans were considered:" + + "Sorry not implemented yet!"); + if (viablePlans.length === 1) { + selectedPlan = viablePlans[0]; + console.info("Selected the release plan for channel, \"".concat((_a = selectedPlan.channel) === null || _a === void 0 ? void 0 : _a.Name, "\".")); + return [2 /*return*/, selectedPlan]; + } + if (viablePlans.length > 1 && viablePlans.some(function (p) { var _a; return (_a = p.channel) === null || _a === void 0 ? void 0 : _a.IsDefault; })) { + selectedPlan = viablePlans.find(function (p) { var _a; return (_a = p.channel) === null || _a === void 0 ? void 0 : _a.IsDefault; }); + console.info("Selected the release plan for channel \"".concat((_b = selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.channel) === null || _b === void 0 ? void 0 : _b.Name, "\" - there were multiple matching Channels (").concat(viablePlans + .map(function (p) { var _a; return (_a = p.channel) === null || _a === void 0 ? void 0 : _a.Name; }) + .reduce(function (previousValue, currentValue) { return "".concat(previousValue, ",").concat(currentValue); }, ""), ") so we selected the default channel.")); + return [2 /*return*/, selectedPlan]; + } + throw new Error("There are ".concat(viablePlans.length, " viable release plans using the provided arguments so we cannot auto-select one. The viable release plans are:") + + "Sorry not implemented yet!" + + "The unviable release plans are:" + + "Sorry not implemented yet!"); + } + }); + }); + }; + CreateRelease.prototype.getMatchingChannel = function (channelNameOrId) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + return [2 /*return*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, this.repository.channels.find(nameOrId)]; + }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, this.repository.channels.get(id)]; + }); }); }, "Channels", "channel", channelNameOrId)]; + }); + }); + }; + CreateRelease.prototype.validateProjectPersistenceRequirements = function () { + var wasGitRefProvided = this.releaseOptions.gitRef; + if (!wasGitRefProvided && this.project.PersistenceSettings.Type === message_contracts_1.PersistenceSettingsType.VersionControlled) { + this.gitReference = this.project.PersistenceSettings.DefaultBranch; + console.info("No gitRef parameter provided. Using Project Default Branch: ".concat(this.project.PersistenceSettings.DefaultBranch)); + } + if (!this.project.IsVersionControlled && wasGitRefProvided) + throw new Error("Since the provided project is not a version controlled project," + + " the --gitCommit and --gitRef arguments are not supported for this command."); + }; + return CreateRelease; +}(deployment_base_1.DeploymentBase)); + + +/***/ }), + +/***/ 70067: +/***/ (function(__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; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(77948), exports); +__exportStar(__nccwpck_require__(35307), exports); +__exportStar(__nccwpck_require__(89489), exports); +__exportStar(__nccwpck_require__(42235), exports); +__exportStar(__nccwpck_require__(40744), exports); +__exportStar(__nccwpck_require__(43817), exports); +__exportStar(__nccwpck_require__(43179), exports); + + +/***/ }), + +/***/ 35307: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageIdentity = void 0; +var PackageIdentity = /** @class */ (function () { + function PackageIdentity(id, version) { + this.id = id; + this.version = version; + } + return PackageIdentity; +}()); +exports.PackageIdentity = PackageIdentity; + + +/***/ }), + +/***/ 89489: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageVersionResolver = void 0; +var glob_1 = __importDefault(__nccwpck_require__(91957)); +var path_1 = __importDefault(__nccwpck_require__(71017)); +var semver_1 = __nccwpck_require__(11383); +var package_identity_1 = __nccwpck_require__(35307); +var WildCard = "*"; +function packageKey(stepNameOrPackageId, referenceName) { + return "".concat(stepNameOrPackageId, ":").concat(referenceName).toLowerCase(); +} +var PackageVersionResolver = /** @class */ (function () { + function PackageVersionResolver() { + this.stepNameToVersion = new Map(); + } + PackageVersionResolver.prototype.addFolder = function (folderPath) { + return __awaiter(this, void 0, void 0, function () { + var retrievePackages, files, _i, files_1, file, packageIdentity; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + retrievePackages = function (pattern) { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { + (0, glob_1.default)("".concat(folderPath, "/**/").concat(pattern), {}, function (err, matches) { + if (err) { + reject(err); + return; + } + resolve(matches); + }); + })]; + }); + }); }; + console.debug("Using package versions from '".concat(folderPath, "' folder")); + return [4 /*yield*/, retrievePackages("*(".concat(PackageVersionResolver.SupportedZipFilePatterns.map(function (v) { return v; }).join("|"), ")"))]; + case 1: + files = _a.sent(); + for (_i = 0, files_1 = files; _i < files_1.length; _i++) { + file = files_1[_i]; + console.debug("Package file: ".concat(file)); + packageIdentity = this.tryParseIdAndVersion(file); + if (packageIdentity) { + this.add(packageIdentity.id, undefined, packageIdentity.version); + } + } + return [2 /*return*/]; + } + }); + }); + }; + PackageVersionResolver.prototype.add3 = function (stepNameOrPackageIdAndVersion) { + var split = stepNameOrPackageIdAndVersion.split(/[:=/]+/); + if (split.length < 2) + throw new Error("The package argument '".concat(stepNameOrPackageIdAndVersion, "' does not use expected format of : {Step Name}:{Version}")); + var stepNameOrPackageId = split[0]; + var packageReferenceName = split.length > 2 ? split[1] : WildCard; + var version = split.length > 2 ? split[2] : split[1]; + if (!stepNameOrPackageId || !version) + throw new Error("The package argument '".concat(stepNameOrPackageIdAndVersion, "' does not use expected format of : {Step Name}:{Version}")); + this.add(stepNameOrPackageId, packageReferenceName, version); + }; + PackageVersionResolver.prototype.addPackage = function (stepNameOrPackageId, packageVersion) { + this.add(stepNameOrPackageId, "", packageVersion); + }; + PackageVersionResolver.prototype.add = function (stepNameOrPackageId, packageReferenceName, packageVersion) { + // Double wild card == default value + if (stepNameOrPackageId === WildCard && packageReferenceName === WildCard) { + this.setDefault(packageVersion); + return; + } + var key = packageKey(stepNameOrPackageId, packageReferenceName !== null && packageReferenceName !== void 0 ? packageReferenceName : WildCard); + var current = this.stepNameToVersion.get(key); + if (current !== undefined) { + var newVersion = new semver_1.SemVer(packageVersion); + var currentVersion = new semver_1.SemVer(current); + if (newVersion.compare(currentVersion) < 0) + return; + } + this.stepNameToVersion.set(key, packageVersion); + }; + PackageVersionResolver.prototype.setDefault = function (packageVersion) { + if ((0, semver_1.valid)(packageVersion) === null) { + throw new Error("Invalid package version"); + } + this.defaultVersion = packageVersion; + }; + PackageVersionResolver.prototype.tryParseIdAndVersion = function (filename) { + var _a, _b; + var idAndVersion = path_1.default.basename(filename, path_1.default.extname(filename)); + var tarExtension = path_1.default.extname(idAndVersion); + if (tarExtension.localeCompare(".tar", undefined, { + sensitivity: "accent", + }) === 0) { + idAndVersion = path_1.default.basename(idAndVersion, tarExtension); + } + var packageIdPattern = /(?(\w+([_.-]\w+)*?))/; + var semanticVersionPattern = new RegExp("(?(\\d+(.\\d+){0,3}" + // Major Minor Patch + "(-[0-9A-Za-z-]+(.[0-9A-Za-z-]+)*)?)" + // Pre-release identifiers + "(\\+[0-9A-Za-z-]+(.[0-9A-Za-z-]+)*)?)"); // Build Metadata + var match = new RegExp("^".concat(packageIdPattern.source, "\\.").concat(semanticVersionPattern.source, "$")).exec(idAndVersion); + var packageIdMatch = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.packageId; + var versionMatch = (_b = match === null || match === void 0 ? void 0 : match.groups) === null || _b === void 0 ? void 0 : _b.semanticVersion; + if (!packageIdMatch || !versionMatch) { + return; + } + var packageId = packageIdMatch; + if (!(0, semver_1.valid)(versionMatch)) { + return; + } + return new package_identity_1.PackageIdentity(packageId, versionMatch); + }; + PackageVersionResolver.prototype.resolveVersion = function (stepName, packageId, packageReferenceName) { + var _this = this; + var _a, _b; + var identifiers = [stepName, packageId]; + return ((_b = (_a = identifiers + .map(function (id) { return packageKey(id, packageReferenceName !== null && packageReferenceName !== void 0 ? packageReferenceName : ""); }) + .map(function (key) { var _a; return (_a = _this.stepNameToVersion.get(key)) !== null && _a !== void 0 ? _a : undefined; }) + .find(function (version) { return version !== undefined; })) !== null && _a !== void 0 ? _a : identifiers + .flatMap(function (id) { return [packageKey(WildCard, packageReferenceName !== null && packageReferenceName !== void 0 ? packageReferenceName : ""), packageKey(id, WildCard)]; }) + .map(function (key) { var _a; return (_a = _this.stepNameToVersion.get(key)) !== null && _a !== void 0 ? _a : undefined; }) + .find(function (version) { return version !== undefined; })) !== null && _b !== void 0 ? _b : this.defaultVersion); + }; + PackageVersionResolver.SupportedZipFilePatterns = ["*.zip", "*.tgz", "*.tar.gz", "*.tar.Z", "*.tar.bz2", "*.tar.bz", "*.tbz", "*.tar", "*.nupkg"]; + return PackageVersionResolver; +}()); +exports.PackageVersionResolver = PackageVersionResolver; + + +/***/ }), + +/***/ 42235: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 43817: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReleasePlanBuilder = void 0; +var could_not_find_error_1 = __nccwpck_require__(62407); +var release_plan_1 = __nccwpck_require__(40744); +var GitReferenceMissingForVersionControlledProjectErrorMessage = "Attempting to create a release for a version controlled project, but no git reference has been provided. Use the gitRef parameter to supply a git reference."; +var ReleasePlanBuilder = /** @class */ (function () { + function ReleasePlanBuilder(client, versionResolver, channelVersionRuleTester) { + this.client = client; + this.versionResolver = versionResolver; + this.channelVersionRuleTester = channelVersionRuleTester; + } + ReleasePlanBuilder.gitReferenceSuppliedForDatabaseProjectErrorMessage = function (gitObjectName) { + return "Attempting to create a release from version control because the git ".concat(gitObjectName, " was provided. The selected project is not a version controlled project."); + }; + ReleasePlanBuilder.loadFeedsForSteps = function (repository, project, steps) { + return __awaiter(this, void 0, void 0, function () { + var allRelevantFeedIdOrName, allRelevantFeeds; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + allRelevantFeedIdOrName = steps.map(function (step) { return step.packageFeedId; }).filter(function (feedId) { return feedId !== undefined; }); + return [4 /*yield*/, repository.feeds.list({ + ids: allRelevantFeedIdOrName, + take: repository.feeds.takeAll, + })]; + case 1: + allRelevantFeeds = _a.sent(); + return [2 /*return*/, new Map(project.IsVersionControlled ? allRelevantFeeds.Items.map(function (p) { return [p.Name, p]; }) : allRelevantFeeds.Items.map(function (p) { return [p.Id, p]; }))]; + } + }); + }); + }; + ReleasePlanBuilder.prototype.buildChannelVersionFilters = function (stepName, packageReferenceName, channel) { + var filters = {}; + if (channel === undefined) + return filters; + var rule = channel.Rules.find(function (r) { + return r.ActionPackages.some(function (pkg) { + var _a; + return pkg.DeploymentAction.localeCompare(stepName, undefined, { + sensitivity: "accent", + }) === 0 && + ((_a = pkg.PackageReference) === null || _a === void 0 ? void 0 : _a.localeCompare(packageReferenceName, undefined, { + sensitivity: "accent", + })) === 0; + }); + }); + if (rule === null || rule === undefined) + return filters; + if (!rule.VersionRange) + filters["versionRange"] = rule.VersionRange; + if (!rule.Tag) + filters["preReleaseTag"] = rule.Tag; + return filters; + }; + ReleasePlanBuilder.prototype.build = function (repository, project, channel, versionPreReleaseTag, gitReference, gitCommit) { + return __awaiter(this, void 0, void 0, function () { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!!gitReference) return [3 /*break*/, 2]; + return [4 /*yield*/, this.buildReleaseFromDatabase(repository, project, channel, versionPreReleaseTag)]; + case 1: + _a = _b.sent(); + return [3 /*break*/, 4]; + case 2: return [4 /*yield*/, this.buildReleaseFromVersionControl(repository, project, channel, versionPreReleaseTag, gitReference, gitCommit)]; + case 3: + _a = _b.sent(); + _b.label = 4; + case 4: return [2 /*return*/, _a]; + } + }); + }); + }; + ReleasePlanBuilder.prototype.buildReleaseFromDatabase = function (repository, project, channel, versionPreReleaseTag) { + return __awaiter(this, void 0, void 0, function () { + var deploymentProcess, releaseTemplate; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (project.IsVersionControlled) + throw new Error(GitReferenceMissingForVersionControlledProjectErrorMessage); + console.debug("Finding deployment process..."); + return [4 /*yield*/, repository.deploymentProcesses.get(project.DeploymentProcessId, undefined)]; + case 1: + deploymentProcess = _a.sent(); + if (deploymentProcess === undefined) + throw new could_not_find_error_1.CouldNotFindError("a deployment process for project \"".concat(project.Name, "\"")); + console.debug("Finding release template..."); + return [4 /*yield*/, repository.deploymentProcesses.getTemplate(deploymentProcess, channel)]; + case 2: + releaseTemplate = _a.sent(); + if (releaseTemplate === undefined) + throw new could_not_find_error_1.CouldNotFindError(channel ? "a release template for project \"".concat(project.Name, "\" and channel \"").concat(channel.Name, "\"") : "A release template for project \"".concat(project.Name, "\"")); + return [4 /*yield*/, this.buildInternal(repository, project, channel, versionPreReleaseTag, releaseTemplate, deploymentProcess)]; + case 3: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + ReleasePlanBuilder.prototype.buildReleaseFromVersionControl = function (repository, project, channel, versionPreReleaseTag, gitReference, gitCommit) { + return __awaiter(this, void 0, void 0, function () { + var gitObject, gitObjectName, deploymentProcess, releaseTemplate; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + gitObject = !gitCommit ? gitReference : gitCommit; + gitObjectName = !gitCommit ? "reference ".concat(gitReference) : "commit ".concat(gitCommit); + if (!project.IsVersionControlled) + throw new Error(ReleasePlanBuilder.gitReferenceSuppliedForDatabaseProjectErrorMessage(gitObjectName)); + console.debug("Finding deployment process at git ".concat(gitObjectName, "...")); + return [4 /*yield*/, repository.deploymentProcesses.get(project.DeploymentProcessId, gitObject)]; + case 1: + deploymentProcess = _a.sent(); + if (deploymentProcess === undefined) + throw new could_not_find_error_1.CouldNotFindError("a deployment process for project \"".concat(project.Name, "\" and git ").concat(gitObjectName, ".")); + console.debug("Finding release template at git ".concat(gitObjectName, "...")); + return [4 /*yield*/, repository.deploymentProcesses.getTemplate(deploymentProcess, channel)]; + case 2: + releaseTemplate = _a.sent(); + if (releaseTemplate === undefined) + throw new could_not_find_error_1.CouldNotFindError("a release template for project \"".concat(project.Name, "\", channel \"").concat(channel.Name, "\" and git ").concat(gitObjectName, ".")); + return [4 /*yield*/, this.buildInternal(repository, project, channel, versionPreReleaseTag, releaseTemplate, deploymentProcess)]; + case 3: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + ReleasePlanBuilder.prototype.buildInternal = function (repository, project, channel, versionPreReleaseTag, releaseTemplate, deploymentProcess) { + return __awaiter(this, void 0, void 0, function () { + var plan, allRelevantFeeds, _i, _a, unresolved, feed, filters, packages, latestPackage, _loop_1, this_1, _b, _c, step; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + plan = new release_plan_1.ReleasePlan(project, channel, releaseTemplate, deploymentProcess, this.versionResolver); + if (!(plan.unresolvedSteps.length > 0)) return [3 /*break*/, 5]; + console.debug("The package version for some steps was not specified. Attempting to resolve those automatically..."); + return [4 /*yield*/, ReleasePlanBuilder.loadFeedsForSteps(repository, project, plan.unresolvedSteps)]; + case 1: + allRelevantFeeds = _d.sent(); + _i = 0, _a = plan.unresolvedSteps; + _d.label = 2; + case 2: + if (!(_i < _a.length)) return [3 /*break*/, 5]; + unresolved = _a[_i]; + if (!unresolved.isResolvable) { + console.error("The version number for step, \"".concat(unresolved.actionName, "\" cannot be automatically resolved because the feed or package ID is dynamic.")); + return [3 /*break*/, 4]; + } + if (versionPreReleaseTag) + console.debug("Finding latest package with pre-release \"".concat(versionPreReleaseTag, "\" for step, \"").concat(unresolved.actionName, "\"...")); + else + console.debug("Finding latest package for step, \"".concat(unresolved.actionName, "\"...")); + if (!allRelevantFeeds.has(unresolved.packageFeedId)) { + throw new Error("Could not find a feed with ID \"".concat(unresolved.packageFeedId, "\", which is used by step: \"").concat(unresolved.actionName, "\".")); + } + feed = allRelevantFeeds.get(unresolved.packageFeedId); + filters = this.buildChannelVersionFilters(unresolved.actionName, unresolved.packageReferenceName, channel); + filters["packageId"] = unresolved.packageId; + if (versionPreReleaseTag) + filters["preReleaseTag"] = versionPreReleaseTag; + return [4 /*yield*/, this.client.get(feed.Links.SearchTemplate, filters)]; + case 3: + packages = _d.sent(); + latestPackage = packages[0]; + if (packages.length === 0) { + console.info("Could not find any packages with ID \"".concat(unresolved.packageId, "\" that match the channel filter, in the feed, \"").concat(feed.Name, "\".")); + } + else { + console.debug("Selected \"".concat(latestPackage.PackageId, "\" version \"").concat(latestPackage.Version, "\" for \"").concat(unresolved.actionName, "\".")); + unresolved.setVersionFromLatest(latestPackage.Version); + } + _d.label = 4; + case 4: + _i++; + return [3 /*break*/, 2]; + case 5: + if (!(channel !== undefined)) return [3 /*break*/, 9]; + _loop_1 = function (step) { + var rule, result; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + rule = channel.Rules.find(function (r) { + return r.ActionPackages.some(function (pkg) { + var _a; + return pkg.DeploymentAction.localeCompare(step.actionName, undefined, { + sensitivity: "accent", + }) === 0 && + ((_a = pkg.PackageReference) === null || _a === void 0 ? void 0 : _a.localeCompare(step.packageReferenceName, undefined, { + sensitivity: "accent", + })) === 0; + }); + }); + return [4 /*yield*/, this_1.channelVersionRuleTester.test(rule, step.version, step.packageFeedId)]; + case 1: + result = _e.sent(); + step.setChannelVersionRuleTestResult(result); + return [2 /*return*/]; + } + }); + }; + this_1 = this; + _b = 0, _c = plan.packageSteps; + _d.label = 6; + case 6: + if (!(_b < _c.length)) return [3 /*break*/, 9]; + step = _c[_b]; + return [5 /*yield**/, _loop_1(step)]; + case 7: + _d.sent(); + _d.label = 8; + case 8: + _b++; + return [3 /*break*/, 6]; + case 9: return [2 /*return*/, plan]; + } + }); + }); + }; + return ReleasePlanBuilder; +}()); +exports.ReleasePlanBuilder = ReleasePlanBuilder; + + +/***/ }), + +/***/ 43179: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReleasePlanItem = void 0; +var ReleasePlanItem = /** @class */ (function () { + function ReleasePlanItem(actionName, packageReferenceName, packageId, packageFeedId, isResolvable, userSpecifiedVersion) { + this.actionName = actionName; + this.packageReferenceName = packageReferenceName; + this.packageId = packageId; + this.packageFeedId = packageFeedId; + this.isResolvable = isResolvable; + this.isDisabled = false; + this.version = userSpecifiedVersion; + this.versionSource = !this.version ? "Cannot resolve" : "User specified"; + } + ReleasePlanItem.prototype.setVersionFromLatest = function (version) { + this.version = version; + this.versionSource = "Latest available"; + }; + ReleasePlanItem.prototype.setChannelVersionRuleTestResult = function (result) { + this.channelVersionRuleTestResult = result; + }; + return ReleasePlanItem; +}()); +exports.ReleasePlanItem = ReleasePlanItem; + + +/***/ }), + +/***/ 40744: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReleasePlan = void 0; +var release_plan_item_1 = __nccwpck_require__(43179); +var ReleasePlan = /** @class */ (function () { + function ReleasePlan(project, channel, releaseTemplate, deploymentProcess, versionResolver) { + this.project = project; + this.channel = channel; + this.releaseTemplate = releaseTemplate; + this.versionResolver = versionResolver; + this.scriptSteps = deploymentProcess.Steps.flatMap(function (s) { return s.Actions; }) + .map(function (a) { + var _a, _b; + return ({ + stepName: a.Name, + packageId: (_a = a.Properties["Octopus.Action.Package.PackageId"]) !== null && _a !== void 0 ? _a : "", + feedId: (_b = a.Properties["Octopus.Action.Package.FeedId"]) !== null && _b !== void 0 ? _b : "", + isDisabled: a.IsDisabled, + channels: a.Channels, + }); + }) + .filter(function (x) { return !x.packageId && !x.isDisabled; }) // only consider enabled script steps + .filter(function (a) { return a.channels.length === 0 || a.channels.find(function (id) { return id === (channel === null || channel === void 0 ? void 0 : channel.Id); }); }) // only include actions without channel scope or with a matching channel scope + .map(function (x) { + var releasePlanItem = new release_plan_item_1.ReleasePlanItem(x.stepName, undefined, undefined, undefined, true, undefined); + releasePlanItem.isDisabled = x.isDisabled; + return releasePlanItem; + }); + this.packageSteps = releaseTemplate.Packages.map(function (p) { + return new release_plan_item_1.ReleasePlanItem(p.ActionName, p.PackageReferenceName, p.PackageId, p.FeedId, p.IsResolvable, versionResolver.resolveVersion(p.ActionName, p.PackageId, p.PackageReferenceName)); + }); + } + Object.defineProperty(ReleasePlan.prototype, "unresolvedSteps", { + get: function () { + return this.packageSteps.filter(function (s) { return !s.version; }); + }, + enumerable: false, + configurable: true + }); + ReleasePlan.prototype.channelHasAnyEnabledSteps = function () { + return ReleasePlan.anyEnabled(this.packageSteps) || ReleasePlan.anyEnabled(this.scriptSteps); + }; + ReleasePlan.anyEnabled = function (items) { + return items.some(function (x) { return !x.isDisabled; }); + }; + ReleasePlan.prototype.isViableReleasePlan = function () { + return !this.hasUnresolvedSteps() && !this.hasStepsViolatingChannelVersionRules() && this.channelHasAnyEnabledSteps(); + }; + ReleasePlan.prototype.hasUnresolvedSteps = function () { + return this.unresolvedSteps.length > 0; + }; + ReleasePlan.prototype.hasStepsViolatingChannelVersionRules = function () { + return this.channel !== undefined && this.packageSteps.some(function (s) { var _a; return ((_a = s.channelVersionRuleTestResult) === null || _a === void 0 ? void 0 : _a.isSatisfied) !== true; }); + }; + ReleasePlan.prototype.formatAsTable = function () { + return undefined; + }; + ReleasePlan.prototype.getActionVersionNumber = function (packageStepName, packageReferenceName) { + var step = this.packageSteps.find(function (s) { + return s.actionName.localeCompare(packageStepName, undefined, { + sensitivity: "accent", + }) === 0 && + (!s.packageReferenceName || s.packageReferenceName.localeCompare(packageReferenceName !== null && packageReferenceName !== void 0 ? packageReferenceName : "", undefined, { sensitivity: "accent" }) === 0); + }); + if (step === undefined) + throw new Error("The step '".concat(packageStepName, "' is configured to provide the package version number but doesn't exist in the release plan.")); + if (!step.version) + throw new Error("The step '".concat(packageStepName, "' provides the release version number but no package version could be determined from it.")); + return step.version; + }; + ReleasePlan.prototype.getSelections = function () { + return this.packageSteps.map(function (x) { return ({ + ActionName: x.actionName, + PackageReferenceName: x.packageReferenceName, + Version: x.version, + }); }); + }; + return ReleasePlan; +}()); +exports.ReleasePlan = ReleasePlan; + + +/***/ }), + +/***/ 92351: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.deployRelease = void 0; +var semver_1 = __nccwpck_require__(11383); +var clientConfiguration_1 = __nccwpck_require__(5966); +var could_not_find_error_1 = __nccwpck_require__(62407); +var throw_if_undefined_1 = __nccwpck_require__(70347); +var deployment_base_1 = __nccwpck_require__(5548); +function deployRelease(repository, project, version, deployTo, channel, updateVariables, deploymentOptions) { + return __awaiter(this, void 0, void 0, function () { + var proj, configuration; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, repository.projects.find(nameOrId)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, repository.projects.get(id)]; + }); }); }, "Projects", "project", project.Id)]; + case 1: + proj = _a.sent(); + configuration = (0, clientConfiguration_1.processConfiguration)(); + return [4 /*yield*/, new DeployRelease(repository, configuration.apiUri, proj, deployTo, deploymentOptions).execute(version, channel, updateVariables)]; + case 2: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} +exports.deployRelease = deployRelease; +var DeployRelease = /** @class */ (function (_super) { + __extends(DeployRelease, _super); + function DeployRelease(repository, serverUrl, project, deployTo, deploymentOptions) { + var _this = _super.call(this, repository, serverUrl, __assign(__assign({}, deploymentOptions), { deployTo: deployTo })) || this; + _this.project = project; + return _this; + } + DeployRelease.prototype.execute = function (version, channel, updateVariables) { + if (updateVariables === void 0) { updateVariables = false; } + return __awaiter(this, void 0, void 0, function () { + var channelResource, releaseToPromote; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + channelResource = undefined; + if (!channel) return [3 /*break*/, 2]; + return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.repository.channels.find(nameOrId)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, this.repository.channels.get(id)]; + }); }); }, "Channels", "channel", channel.Name)]; + case 1: + channelResource = _a.sent(); + _a.label = 2; + case 2: return [4 /*yield*/, this.getReleaseByVersion(version, this.project, channelResource)]; + case 3: + releaseToPromote = _a.sent(); + if (!updateVariables) return [3 /*break*/, 5]; + console.debug("Updating the release variable snapshot with variables from the project"); + return [4 /*yield*/, this.repository.releases.snapshotVariables(releaseToPromote)]; + case 4: + _a.sent(); + _a.label = 5; + case 5: return [4 /*yield*/, this.deployRelease(this.project, releaseToPromote)]; + case 6: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + DeployRelease.prototype.getReleaseByVersion = function (versionNumber, project, channel) { + return __awaiter(this, void 0, void 0, function () { + var releaseToPromote, message, releases, compareFn_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + releaseToPromote = undefined; + if (!(versionNumber === "latest")) return [3 /*break*/, 7]; + message = channel === null ? "latest release for project" : "latest release in channel '".concat(channel === null || channel === void 0 ? void 0 : channel.Name, "'"); + console.debug("Finding ".concat(message, "...")); + return [4 /*yield*/, this.repository.projects.getReleases(project)]; + case 1: + releases = _a.sent(); + compareFn_1 = function (r1, r2) { + var r1Version = new semver_1.SemVer(r1.Version); + var r2Version = new semver_1.SemVer(r2.Version); + return r1Version.compare(r2Version); + }; + if (!(releases.TotalResults > 0)) return [3 /*break*/, 5]; + if (!(channel === undefined)) return [3 /*break*/, 2]; + releaseToPromote = releases.Items.sort(compareFn_1)[0]; + return [3 /*break*/, 4]; + case 2: return [4 /*yield*/, this.paginate(releases, this.repository, function (page) { + releaseToPromote = page.Items.sort(compareFn_1).find(function (r) { return r.ChannelId === channel.Id; }); + // If we haven't found one yet, keep paginating + return releaseToPromote === undefined; + })]; + case 3: + _a.sent(); + _a.label = 4; + case 4: return [3 /*break*/, 7]; + case 5: + console.debug("Finding release ".concat(versionNumber)); + return [4 /*yield*/, this.repository.projects.getReleaseByVersion(project, versionNumber)]; + case 6: + releaseToPromote = _a.sent(); + _a.label = 7; + case 7: + if (releaseToPromote === undefined) + throw new could_not_find_error_1.CouldNotFindError("the ".concat(project.Name)); + return [2 /*return*/, releaseToPromote]; + } + }); + }); + }; + DeployRelease.prototype.paginate = function (source, repository, getNextPage) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(getNextPage(source) && source.Items.length > 0 && source.Links["Page.Next"])) return [3 /*break*/, 2]; + return [4 /*yield*/, repository.client.get(source.Links["Page.Next"])]; + case 1: + source = _a.sent(); + return [3 /*break*/, 0]; + case 2: return [2 /*return*/]; + } + }); + }); + }; + return DeployRelease; +}(deployment_base_1.DeploymentBase)); + + +/***/ }), + +/***/ 5548: +/***/ (function(__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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DeploymentBase = void 0; +var form_1 = __nccwpck_require__(11110); +var moment_1 = __importDefault(__nccwpck_require__(99623)); +var could_not_find_error_1 = __nccwpck_require__(62407); +var throw_if_undefined_1 = __nccwpck_require__(70347); +var execution_resource_waiter_1 = __nccwpck_require__(59634); +function deploymentOptionsDefaults() { + return { + cancelOnTimeout: false, + deployTo: [], + deploymentCheckSleepCycle: 10000, + deploymentTimeout: 600000, + excludeMachines: [], + force: false, + forcePackageDownload: false, + noRawLog: false, + progress: true, + skipStepNames: [], + specificMachines: [], + tenantTags: [], + tenants: [], + variable: [], + waitForDeployment: false, + }; +} +var DeploymentBase = /** @class */ (function () { + function DeploymentBase(repository, serverUrl, deploymentConfiguration) { + this.repository = repository; + this.serverUrl = serverUrl; + this.deployments = []; + this.promotionTargets = []; + this.deploymentOptions = __assign(__assign({}, deploymentOptionsDefaults()), deploymentConfiguration); + } + DeploymentBase.prototype.deployRelease = function (project, release) { + return __awaiter(this, void 0, void 0, function () { + var _a, _b, waiter; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + _a = this; + if (!(this.deploymentOptions.tenants.length > 0 || this.deploymentOptions.tenantTags.length > 0)) return [3 /*break*/, 2]; + return [4 /*yield*/, this.deployTenantedRelease(project, release)]; + case 1: + _b = _c.sent(); + return [3 /*break*/, 4]; + case 2: return [4 /*yield*/, this.deployToEnvironments(project, release)]; + case 3: + _b = _c.sent(); + _c.label = 4; + case 4: + _a.deployments = _b; + if (!(this.deployments.length > 0 && this.deploymentOptions.waitForDeployment)) return [3 /*break*/, 6]; + waiter = new execution_resource_waiter_1.ExecutionResourceWaiter(this.repository, this.serverUrl); + return [4 /*yield*/, waiter.waitForDeploymentToComplete(this.deployments, project, release, this.deploymentOptions.progress, this.deploymentOptions.noRawLog, this.deploymentOptions.rawLogFile, this.deploymentOptions.cancelOnTimeout, this.deploymentOptions.deploymentCheckSleepCycle, this.deploymentOptions.deploymentTimeout)]; + case 5: + _c.sent(); + _c.label = 6; + case 6: return [2 /*return*/]; + } + }); + }); + }; + DeploymentBase.prototype.getTenants = function (project, environmentName, release, releaseTemplate) { + return __awaiter(this, void 0, void 0, function () { + var deployableTenants, tenantPromotions, tenants, tenantsByNameOrId, unDeployableTenants, tenantsByTag, deployableByTag; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this.deploymentOptions.tenants.length === 0 && this.deploymentOptions.tenantTags.length === 0) + return [2 /*return*/, []]; + deployableTenants = []; + if (!this.deploymentOptions.tenants.some(function (t) { return t.Id === "*"; })) return [3 /*break*/, 2]; + tenantPromotions = releaseTemplate.TenantPromotions.filter(function (tp) { + return tp.PromoteTo.some(function (promo) { + return promo.Name.localeCompare(environmentName, undefined, { + sensitivity: "accent", + }) === 0; + }); + }).map(function (tp) { return tp.Id; }); + return [4 /*yield*/, this.repository.tenants.all({ + ids: tenantPromotions, + })]; + case 1: + tenants = _a.sent(); + deployableTenants.push.apply(deployableTenants, tenants); + console.info("Found ".concat(deployableTenants.length, " tenant(s) who can deploy ").concat(project.Name, " ").concat(release.Version, " to ").concat(environmentName)); + return [3 /*break*/, 6]; + case 2: + if (!(this.deploymentOptions.tenants.length > 0)) return [3 /*break*/, 4]; + return [4 /*yield*/, this.repository.tenants.find(this.deploymentOptions.tenants.map(function (t) { return t.Id; }))]; + case 3: + tenantsByNameOrId = _a.sent(); + deployableTenants.push.apply(deployableTenants, tenantsByNameOrId); + unDeployableTenants = deployableTenants.filter(function (dt) { return !dt.ProjectEnvironments.hasOwnProperty(project.Id); }).map(function (dt) { return dt.Name; }); + if (unDeployableTenants.length > 0) + throw new Error("Release '".concat(release.Version, "' of project '").concat(project.Name, "' cannot be deployed for tenant").concat(unDeployableTenants.length === 1 ? "" : "s", " ").concat(unDeployableTenants.join(" or "), ". This may be because either a) ").concat(unDeployableTenants.length === 1 ? "it is" : "they are", " not connected to this project, or b) you do not have permission to deploy ").concat(unDeployableTenants.length === 1 ? "it" : "them", " to this project.")); + unDeployableTenants = deployableTenants + .filter(function (dt) { + var tenantPromo = releaseTemplate.TenantPromotions.find(function (tp) { return tp.Id === dt.Id; }); + return (tenantPromo === undefined || + !(tenantPromo === null || tenantPromo === void 0 ? void 0 : tenantPromo.PromoteTo.some(function (tdt) { + return tdt.Name.localeCompare(environmentName, undefined, { + sensitivity: "accent", + }) === 0; + }))); + }) + .map(function (dt) { return dt.Name; }); + if (unDeployableTenants.length > 0) + throw new Error("Release '".concat(release.Version, "' of project '").concat(project.Name, "' cannot be deployed for tenant").concat(unDeployableTenants.length === 1 ? "" : "s", " ").concat(unDeployableTenants.join(" or "), " to environment '").concat(environmentName, "'. This may be because a) the tenant").concat(unDeployableTenants.length === 1 ? "" : "s", " ").concat(unDeployableTenants.length === 1 ? "is" : "are", " not connected to this environment, a) the environment does not exist or is misspelled, b) The lifecycle has not reached this phase, possibly due to previous deployment failure, c) you don't have permission to deploy to this environment, d) the environment is not in the list of environments defined by the lifecycle, or e) ").concat(unDeployableTenants.length === 1 ? "it is" : "they are", " unable to deploy to this channel.")); + _a.label = 4; + case 4: + if (!(this.deploymentOptions.tenantTags.length > 0)) return [3 /*break*/, 6]; + return [4 /*yield*/, this.repository.tenants.list({ + tags: this.deploymentOptions.tenantTags.toString(), + take: this.repository.tenants.takeAll, + })]; + case 5: + tenantsByTag = _a.sent(); + deployableByTag = tenantsByTag.Items.filter(function (dt) { + var tenantPromo = releaseTemplate.TenantPromotions.find(function (tp) { return tp.Id === dt.Id; }); + return (tenantPromo !== undefined && + tenantPromo.PromoteTo.some(function (tdt) { + return tdt.Name.localeCompare(environmentName, undefined, { + sensitivity: "accent", + }) === 0; + })); + }).filter(function (tenant) { return !deployableTenants.some(function (deployable) { return deployable.Id === tenant.Id; }); }); + deployableTenants.push.apply(deployableTenants, deployableByTag); + _a.label = 6; + case 6: + if (deployableTenants.length === 0) + throw new Error("No tenants are available to be deployed for release '".concat(release.Version, "' of project '").concat(project.Name, "' to environment '").concat(environmentName, "'. This may be because a) No tenants matched the tags provided b) The tenants that do match are not connected to this project or environment, c) The tenants that do match are not yet able to release to this lifecycle phase, or d) you do not have the appropriate deployment permissions.")); + return [2 /*return*/, deployableTenants]; + } + }); + }); + }; + DeploymentBase.prototype.getSpecificMachines = function () { + return __awaiter(this, void 0, void 0, function () { + var specificMachineIds, machines_1, missing; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + specificMachineIds = []; + if (!(this.deploymentOptions.specificMachines.length > 0)) return [3 /*break*/, 2]; + return [4 /*yield*/, this.repository.machines.all({ + ids: this.deploymentOptions.specificMachines, + })]; + case 1: + machines_1 = _a.sent(); + missing = this.deploymentOptions.specificMachines.filter(function (id) { return !machines_1.some(function (value) { return value.Id === id; }); }); + if (missing.length > 0) + throw could_not_find_error_1.CouldNotFindError.createResource("machine", missing.toString()); + specificMachineIds.push.apply(specificMachineIds, machines_1.map(function (m) { return m.Id; })); + _a.label = 2; + case 2: return [2 /*return*/, specificMachineIds]; + } + }); + }); + }; + DeploymentBase.prototype.getExcludedMachines = function () { + return __awaiter(this, void 0, void 0, function () { + var excludedMachineIds, machines_2, missing; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + excludedMachineIds = []; + if (!(this.deploymentOptions.excludeMachines.length > 0)) return [3 /*break*/, 2]; + return [4 /*yield*/, this.repository.machines.all({ + ids: this.deploymentOptions.excludeMachines, + })]; + case 1: + machines_2 = _a.sent(); + missing = this.deploymentOptions.excludeMachines.filter(function (id) { return !machines_2.some(function (value) { return value.Id === id; }); }); + if (missing.length > 0) + throw could_not_find_error_1.CouldNotFindError.createResource("machine", missing.toString()); + excludedMachineIds.push.apply(excludedMachineIds, machines_2.map(function (m) { return m.Id; })); + _a.label = 2; + case 2: return [2 /*return*/, excludedMachineIds]; + } + }); + }); + }; + DeploymentBase.prototype.logScheduledDeployment = function () { + if (this.deploymentOptions.deployAt) { + console.info("Deployment will be scheduled to start at ".concat(this.deploymentOptions.deployAt.toLocaleString())); + } + }; + DeploymentBase.prototype.createDeploymentTask = function (project, release, promotionTarget, specificMachineIds, excludedMachineIds, tenant) { + if (tenant === void 0) { tenant = undefined; } + return __awaiter(this, void 0, void 0, function () { + var preview, skip, _loop_1, _i, _a, step, _loop_2, this_1, _b, _c, element, _d, _e, previewStep, deployment; + return __generator(this, function (_f) { + switch (_f.label) { + case 0: return [4 /*yield*/, this.repository.releases.getDeploymentPreview(promotionTarget)]; + case 1: + preview = _f.sent(); + skip = []; + _loop_1 = function (step) { + var stepToExecute = preview.StepsToExecute.find(function (s) { return s.ActionName === step; }); + if (stepToExecute === undefined) { + console.warn("No step/action named '".concat(step, "' could be found when deploying to environment '").concat(promotionTarget.Name, "', so the step cannot be skipped.")); + } + else { + console.debug("Skipping step: ".concat(stepToExecute.ActionName)); + skip.push(stepToExecute.ActionId); + } + }; + for (_i = 0, _a = this.deploymentOptions.skipStepNames; _i < _a.length; _i++) { + step = _a[_i]; + _loop_1(step); + } + // Validate form values supplied + if (preview.Form !== null && preview.Form.Elements !== null && preview.Form.Values !== null) { + _loop_2 = function (element) { + if (element.Control.Type !== form_1.ControlType.VariableValue) + return "continue"; + var variableInput = element.Control; + var value = this_1.deploymentOptions.variable.reduce(function (previousValue, currentValue) { + if (previousValue !== undefined) { + return previousValue; + } + var variableName = currentValue.name; + var variableValue = currentValue.value; + if (variableName === variableInput.Label) { + return variableValue.toString(); + } + if (variableName === variableInput.Name) { + return variableValue.toString(); + } + return undefined; + }, undefined); + if (value === undefined && element.IsValueRequired) + throw new Error("Please provide a variable for the prompted value ".concat(variableInput.Label)); + preview.Form.Values[element.Name] = value; + }; + this_1 = this; + for (_b = 0, _c = preview.Form.Elements; _b < _c.length; _b++) { + element = _c[_b]; + _loop_2(element); + } + } + // Log step with no machines + for (_d = 0, _e = preview.StepsToExecute; _d < _e.length; _d++) { + previewStep = _e[_d]; + if (previewStep.HasNoApplicableMachines) + console.warn("Warning: there are no applicable machines roles used by step ".concat(previewStep.ActionName)); + } + return [4 /*yield*/, this.repository.deployments.create({ + ProjectId: project.Id, + TenantId: tenant === null || tenant === void 0 ? void 0 : tenant.Id, + EnvironmentId: promotionTarget.Id, + SkipActions: skip, + ReleaseId: release.Id, + ForcePackageDownload: this.deploymentOptions.forcePackageDownload, + UseGuidedFailure: preview.UseGuidedFailureModeByDefault, + SpecificMachineIds: specificMachineIds, + ExcludedMachineIds: excludedMachineIds, + ForcePackageRedeployment: this.deploymentOptions.force, + FormValues: preview.Form.Values, + QueueTime: this.deploymentOptions.deployAt ? (0, moment_1.default)(this.deploymentOptions.deployAt) : undefined, + QueueTimeExpiry: this.deploymentOptions.noDeployAfter ? (0, moment_1.default)(this.deploymentOptions.noDeployAfter) : undefined, + })]; + case 2: + deployment = _f.sent(); + console.info("Deploying ".concat(project.Name, " ").concat(release.Version, " to: ").concat(promotionTarget.Name, " ").concat(tenant === undefined ? "" : "for ".concat(tenant.Name, " "), "(Guided Failure: ").concat(deployment.UseGuidedFailure ? "Enabled" : "Not Enabled", ")")); + return [2 /*return*/, deployment]; + } + }); + }); + }; + DeploymentBase.prototype.deployTenantedRelease = function (project, release) { + return __awaiter(this, void 0, void 0, function () { + var environment, releaseTemplate, deploymentTenants, specificMachineIds, excludedMachineIds, createTasks; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this.deploymentOptions.deployTo.length !== 1) + return [2 /*return*/, []]; + return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.repository.environments.find([nameOrId])]; + case 1: return [2 /*return*/, (_a.sent()).find(function (v) { return v; })]; + } + }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, this.repository.environments.get(id)]; + }); }); }, "Environments", "Environment", this.deploymentOptions.deployTo[0].Name)]; + case 1: + environment = _a.sent(); + return [4 /*yield*/, this.repository.releases.getDeploymentTemplate(release)]; + case 2: + releaseTemplate = _a.sent(); + return [4 /*yield*/, this.getTenants(project, environment.Name, release, releaseTemplate)]; + case 3: + deploymentTenants = _a.sent(); + return [4 /*yield*/, this.getSpecificMachines()]; + case 4: + specificMachineIds = _a.sent(); + return [4 /*yield*/, this.getExcludedMachines()]; + case 5: + excludedMachineIds = _a.sent(); + this.logScheduledDeployment(); + createTasks = deploymentTenants.map(function (tenant) { return __awaiter(_this, void 0, void 0, function () { + var promotion; + var _a; + return __generator(this, function (_b) { + promotion = (_a = releaseTemplate.TenantPromotions.find(function (t) { return t.Id === tenant.Id; })) === null || _a === void 0 ? void 0 : _a.PromoteTo.find(function (tt) { + return tt.Name.localeCompare(environment.Name, undefined, { + sensitivity: "accent", + }) === 0; + }); + this.promotionTargets.push(promotion); + return [2 /*return*/, this.createDeploymentTask(project, release, promotion, specificMachineIds, excludedMachineIds, tenant)]; + }); + }); }); + return [4 /*yield*/, Promise.all(createTasks)]; + case 6: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + DeploymentBase.prototype.deployToEnvironments = function (project, release) { + return __awaiter(this, void 0, void 0, function () { + var releaseTemplate, deployToEnvironments, promotingEnvironments, unknownEnvironments, specificMachineIds, excludedMachineIds, createTasks; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (this.deploymentOptions.deployTo.length === 0) + return [2 /*return*/, []]; + return [4 /*yield*/, this.repository.releases.getDeploymentTemplate(release)]; + case 1: + releaseTemplate = _a.sent(); + return [4 /*yield*/, this.repository.environments.find(this.deploymentOptions.deployTo.map(function (e) { return e.Name; }))]; + case 2: + deployToEnvironments = _a.sent(); + promotingEnvironments = deployToEnvironments.map(function (environment) { return ({ + name: environment.Name, + promotion: releaseTemplate.PromoteTo.find(function (p) { return p.Name === environment.Name; }), + }); }); + unknownEnvironments = promotingEnvironments.filter(function (p) { return p.promotion === undefined; }); + if (unknownEnvironments.length > 0) + throw new Error("Release '".concat(release.Version, "' of project '").concat(project.Name, "' cannot be deployed to ").concat(unknownEnvironments.length === 1 + ? "environment '".concat(unknownEnvironments[0].name, "' because the environment is") + : "environments ".concat(unknownEnvironments.map(function (e) { return "'".concat(e.name, "'"); }), " because the environments are"), " not in the list of environments that this release can be deployed to. This may be because a) the environment does not exist or is misspelled, b) The lifecycle has not reached this phase, possibly due to previous deployment failure, c) you don't have permission to deploy to this environment, or d) the environment is not in the list of environments defined by the lifecycle.")); + this.logScheduledDeployment(); + return [4 /*yield*/, this.getSpecificMachines()]; + case 3: + specificMachineIds = _a.sent(); + return [4 /*yield*/, this.getExcludedMachines()]; + case 4: + excludedMachineIds = _a.sent(); + createTasks = promotingEnvironments.map(function (promotion) { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + this.promotionTargets.push(promotion.promotion); + return [2 /*return*/, this.createDeploymentTask(project, release, promotion.promotion, specificMachineIds, excludedMachineIds)]; + }); + }); }); + return [4 /*yield*/, Promise.all(createTasks)]; + case 5: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + return DeploymentBase; +}()); +exports.DeploymentBase = DeploymentBase; + + +/***/ }), + +/***/ 32703: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 59634: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExecutionResourceWaiter = void 0; +var fs_1 = __nccwpck_require__(57147); +var ExecutionResourceWaiter = /** @class */ (function () { + function ExecutionResourceWaiter(repository, serverBaseUrl) { + this.repository = repository; + this.serverBaseUrl = serverBaseUrl; + } + ExecutionResourceWaiter.prototype.waitForDeploymentToComplete = function (resources, project, release, showProgress, noRawLog, rawLogFile, cancelOnTimeout, deploymentStatusCheckSleepCycle, deploymentTimeout) { + return __awaiter(this, void 0, void 0, function () { + var guidedFailureWarning; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + guidedFailureWarning = function (guidedFailureDeployment) { return __awaiter(_this, void 0, void 0, function () { + var environment; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.repository.client.get(this.repository.client.getLink("Environments"))]; + case 1: + environment = _a.sent(); + console.warn(" - ".concat(environment.Name, ": ").concat(this.getPortalUrl("/app#/projects/".concat(project.Slug, "/releases/").concat(release.Version, "/deployments/").concat(guidedFailureDeployment.Id)))); + return [2 /*return*/]; + } + }); + }); }; + return [4 /*yield*/, this.waitForExecutionToComplete(resources, showProgress, noRawLog, rawLogFile, cancelOnTimeout, deploymentStatusCheckSleepCycle, deploymentTimeout, guidedFailureWarning, "deployment")]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + ExecutionResourceWaiter.prototype.waitForCompletion = function (deploymentTasks, deploymentStatusCheckSleepCycle, deploymentTimeout) { + return __awaiter(this, void 0, void 0, function () { + var sleep, timeout, stop, _i, deploymentTasks_1, deploymentTask, task; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + sleep = function (ms) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, new Promise(function (r) { return setTimeout(r, ms); })]; + }); }); }; + timeout = new Promise(function (r) { return setTimeout(r, deploymentTimeout); }); + stop = false; + // eslint-disable-next-line github/no-then + timeout.then(function () { + stop = true; + }); + _i = 0, deploymentTasks_1 = deploymentTasks; + _a.label = 1; + case 1: + if (!(_i < deploymentTasks_1.length)) return [3 /*break*/, 6]; + deploymentTask = deploymentTasks_1[_i]; + _a.label = 2; + case 2: + if (!!stop) return [3 /*break*/, 5]; + return [4 /*yield*/, this.repository.tasks.get(deploymentTask.Id)]; + case 3: + task = _a.sent(); + if (task.IsCompleted) { + return [3 /*break*/, 5]; + } + return [4 /*yield*/, sleep(deploymentStatusCheckSleepCycle)]; + case 4: + _a.sent(); + return [3 /*break*/, 2]; + case 5: + _i++; + return [3 /*break*/, 1]; + case 6: return [2 /*return*/]; + } + }); + }); + }; + ExecutionResourceWaiter.prototype.waitForExecutionToComplete = function (resources, showProgress, noRawLog, rawLogFile, cancelOnTimeout, deploymentStatusCheckSleepCycle, deploymentTimeout, guidedFailureWarningGenerator, alias) { + return __awaiter(this, void 0, void 0, function () { + var getTasks, deploymentTasks, failed, _i, deploymentTasks_2, deploymentTask, updated, raw, er_1, er_2; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + getTasks = resources.map(function (dep) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, this.repository.tasks.get(dep.TaskId)]; + }); }); }); + return [4 /*yield*/, Promise.all(getTasks)]; + case 1: + deploymentTasks = _a.sent(); + if (showProgress && resources.length > 1) + console.info("Only progress of the first task (".concat(deploymentTasks[0].Name, ") will be shown")); + _a.label = 2; + case 2: + _a.trys.push([2, 15, , 16]); + console.info("Waiting for ".concat(deploymentTasks.length, " ").concat(alias, "(s) to complete...")); + return [4 /*yield*/, this.waitForCompletion(deploymentTasks, deploymentStatusCheckSleepCycle, deploymentTimeout)]; + case 3: + _a.sent(); + failed = false; + _i = 0, deploymentTasks_2 = deploymentTasks; + _a.label = 4; + case 4: + if (!(_i < deploymentTasks_2.length)) return [3 /*break*/, 14]; + deploymentTask = deploymentTasks_2[_i]; + return [4 /*yield*/, this.repository.tasks.get(deploymentTask.Id)]; + case 5: + updated = _a.sent(); + if (!updated.FinishedSuccessfully) return [3 /*break*/, 6]; + console.info("".concat(updated.Description, ": ").concat(updated.State)); + return [3 /*break*/, 13]; + case 6: + console.error("".concat(updated.Description, ": ").concat(updated.State, ", ").concat(updated.ErrorMessage)); + failed = true; + if (noRawLog) + return [3 /*break*/, 13]; + _a.label = 7; + case 7: + _a.trys.push([7, 12, , 13]); + return [4 /*yield*/, this.repository.tasks.getRaw(updated)]; + case 8: + raw = _a.sent(); + if (!rawLogFile) return [3 /*break*/, 10]; + return [4 /*yield*/, fs_1.promises.writeFile(rawLogFile, raw)]; + case 9: + _a.sent(); + return [3 /*break*/, 11]; + case 10: + console.error(raw); + _a.label = 11; + case 11: return [3 /*break*/, 13]; + case 12: + er_1 = _a.sent(); + if (er_1 instanceof Error) { + console.error("Could not retrieve raw log", er_1); + } + return [3 /*break*/, 13]; + case 13: + _i++; + return [3 /*break*/, 4]; + case 14: + if (failed) + throw new Error("One or more ".concat(alias, " tasks failed.")); + console.info("Done!"); + return [3 /*break*/, 16]; + case 15: + er_2 = _a.sent(); + if (er_2 instanceof Error) { + console.error("Failed!", er_2); + } + return [3 /*break*/, 16]; + case 16: return [2 /*return*/]; + } + }); + }); + }; + ExecutionResourceWaiter.prototype.cancelExecutionOnTimeoutIfRequested = function (deploymentTasks, cancelOnTimeout, alias) { + return __awaiter(this, void 0, void 0, function () { + var tasks; + var _this = this; + return __generator(this, function (_a) { + if (!cancelOnTimeout) + return [2 /*return*/]; + tasks = deploymentTasks.map(function (task) { return __awaiter(_this, void 0, void 0, function () { + var er_3; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + console.warn("Cancelling ".concat(alias, " task '{").concat(task.Description, "}'")); + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.repository.tasks.cancel(task)]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + er_3 = _a.sent(); + if (er_3 instanceof Error) { + console.error("Failed to cancel ".concat(alias, " task '{").concat(task.Description, "}': {").concat(er_3.message, "}")); + } + return [3 /*break*/, 4]; + case 4: return [2 /*return*/]; + } + }); + }); }); + return [2 /*return*/, Promise.all(tasks)]; + }); + }); + }; + ExecutionResourceWaiter.prototype.printTaskOutput = function (taskResources) { + return __awaiter(this, void 0, void 0, function () { + var task; + return __generator(this, function (_a) { + task = taskResources[0]; + return [2 /*return*/, this.printTask(task)]; + }); + }); + }; + ExecutionResourceWaiter.prototype.printTask = function (task) { + console.info(task.Name); + }; + ExecutionResourceWaiter.prototype.getPortalUrl = function (path) { + if (!path.startsWith("/")) + path = "/".concat(path); + var uri = new URL(this.serverBaseUrl + path); + return uri.toString(); + }; + return ExecutionResourceWaiter; +}()); +exports.ExecutionResourceWaiter = ExecutionResourceWaiter; + + +/***/ }), + +/***/ 30642: +/***/ (function(__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; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(92351), exports); +__exportStar(__nccwpck_require__(5548), exports); +__exportStar(__nccwpck_require__(32703), exports); +__exportStar(__nccwpck_require__(59634), exports); + + +/***/ }), + +/***/ 77085: +/***/ (function(__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; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(62407), exports); +__exportStar(__nccwpck_require__(70067), exports); +__exportStar(__nccwpck_require__(30642), exports); +__exportStar(__nccwpck_require__(25605), exports); +__exportStar(__nccwpck_require__(42176), exports); +__exportStar(__nccwpck_require__(72092), exports); +__exportStar(__nccwpck_require__(70347), exports); + + +/***/ }), + +/***/ 25605: +/***/ (function(__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; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(69100), exports); + + +/***/ }), + +/***/ 69100: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.promoteRelease = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var semver_1 = __nccwpck_require__(11383); +var clientConfiguration_1 = __nccwpck_require__(5966); +var dashboardRepository_1 = __nccwpck_require__(20009); +var could_not_find_error_1 = __nccwpck_require__(62407); +var deployment_base_1 = __nccwpck_require__(5548); +var throw_if_undefined_1 = __nccwpck_require__(70347); +function promoteRelease(repository, project, from, deployTo, lastSuccessful, updateVariables, deploymentOptions) { + return __awaiter(this, void 0, void 0, function () { + var proj, configuration; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, repository.projects.find(nameOrId)]; + }); }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, repository.projects.get(id)]; + }); }); }, "Projects", "project", project.Id)]; + case 1: + proj = _a.sent(); + configuration = (0, clientConfiguration_1.processConfiguration)(); + return [4 /*yield*/, new PromoteRelease(repository, configuration.apiUri, proj, deployTo, deploymentOptions).execute(from.Name, lastSuccessful, updateVariables)]; + case 2: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} +exports.promoteRelease = promoteRelease; +var PromoteRelease = /** @class */ (function (_super) { + __extends(PromoteRelease, _super); + function PromoteRelease(repository, serverUrl, project, deployTo, deploymentOptions) { + var _this = _super.call(this, repository, serverUrl, __assign(__assign({}, deploymentOptions), { deployTo: deployTo })) || this; + _this.project = project; + return _this; + } + PromoteRelease.prototype.execute = function (from, useLatestSuccessfulRelease, updateVariables) { + if (useLatestSuccessfulRelease === void 0) { useLatestSuccessfulRelease = false; } + if (updateVariables === void 0) { updateVariables = false; } + return __awaiter(this, void 0, void 0, function () { + var environment, dashboardItemsOptions, dashboard, compareFn, dashboardItems, dashboardItem, deploymentType, release; + var _this = this; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, (0, throw_if_undefined_1.throwIfUndefined)(function (nameOrId) { return __awaiter(_this, void 0, void 0, function () { + var results; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.repository.environments.find([nameOrId])]; + case 1: + results = _a.sent(); + return [2 /*return*/, results.length > 0 ? results[0] : undefined]; + } + }); + }); }, function (id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { + return [2 /*return*/, this.repository.environments.get(id)]; + }); }); }, "Environments", "environment", from)]; + case 1: + environment = _a.sent(); + dashboardItemsOptions = useLatestSuccessfulRelease + ? dashboardRepository_1.DashboardItemsOptions.IncludeCurrentAndPreviousSuccessfulDeployment + : dashboardRepository_1.DashboardItemsOptions.IncludeCurrentDeploymentOnly; + return [4 /*yield*/, this.repository.dashboards.getDynamicDashboard([this.project.Id], [environment.Id], dashboardItemsOptions)]; + case 2: + dashboard = _a.sent(); + compareFn = function (r1, r2) { + var r1Version = new semver_1.SemVer(r1.ReleaseVersion); + var r2Version = new semver_1.SemVer(r2.ReleaseVersion); + return r1Version.compare(r2Version); + }; + dashboardItems = dashboard.Items.filter(function (e) { return e.EnvironmentId === environment.Id && e.ProjectId === _this.project.Id; }).sort(compareFn); + dashboardItem = useLatestSuccessfulRelease ? dashboardItems.filter(function (x) { return x.State === message_contracts_1.TaskState.Success; }).at(0) : dashboardItems.at(0); + if (dashboardItem === undefined) { + deploymentType = useLatestSuccessfulRelease ? "successful " : ""; + throw new could_not_find_error_1.CouldNotFindError("latest ".concat(deploymentType, "deployment of the project for this environment. Please check that a ").concat(deploymentType, " deployment for this project/environment exists on the dashboard.")); + } + console.debug("Finding release details for release ".concat(dashboardItem.ReleaseVersion)); + return [4 /*yield*/, this.repository.projects.getReleaseByVersion(this.project, dashboardItem.ReleaseVersion)]; + case 3: + release = _a.sent(); + if (!updateVariables) return [3 /*break*/, 5]; + console.debug("Updating the release variable snapshot with variables from the project"); + return [4 /*yield*/, this.repository.releases.snapshotVariables(release)]; + case 4: + _a.sent(); + _a.label = 5; + case 5: return [4 /*yield*/, this.deployRelease(this.project, release)]; + case 6: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + }; + return PromoteRelease; +}(deployment_base_1.DeploymentBase)); + + +/***/ }), + +/***/ 42176: +/***/ (function(__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; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(99606), exports); + + +/***/ }), + +/***/ 99606: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.pushBuildInformation = void 0; +var packageRepository_1 = __nccwpck_require__(53378); +var connect_1 = __nccwpck_require__(46890); +function pushBuildInformation(space, packages, buildInformation, overwriteMode) { + if (overwriteMode === void 0) { overwriteMode = packageRepository_1.OverwriteMode.FailIfExists; } + return __awaiter(this, void 0, void 0, function () { + var repository, tasks, _i, packages_1, pkg; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, (0, connect_1.connect)(space)]; + case 1: + repository = (_a.sent())[0]; + tasks = []; + for (_i = 0, packages_1 = packages; _i < packages_1.length; _i++) { + pkg = packages_1[_i]; + tasks.push(repository.buildInformation.create({ + PackageId: pkg.id, + Version: pkg.version, + OctopusBuildInformation: { + Branch: buildInformation.branch, + BuildEnvironment: buildInformation.buildEnvironment, + BuildNumber: buildInformation.buildNumber, + BuildUrl: buildInformation.buildUrl, + Commits: buildInformation.commits.map(function (c) { return ({ Id: c.id, Comment: c.comment }); }), + VcsCommitNumber: buildInformation.vcsCommitNumber, + VcsRoot: buildInformation.vcsRoot, + VcsType: buildInformation.vcsType, + }, + }, { overwriteMode: overwriteMode })); + } + return [4 /*yield*/, Promise.all(tasks)]; + case 2: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} +exports.pushBuildInformation = pushBuildInformation; + + +/***/ }), + +/***/ 72092: +/***/ (function(__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; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(64833), exports); + + +/***/ }), + +/***/ 64833: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.pushPackage = void 0; +var fs_1 = __nccwpck_require__(57147); +var readFile = fs_1.promises.readFile; +var path_1 = __importDefault(__nccwpck_require__(71017)); +var packageRepository_1 = __nccwpck_require__(53378); +var connect_1 = __nccwpck_require__(46890); +function pushPackage(space, packages, overwriteMode) { + if (overwriteMode === void 0) { overwriteMode = packageRepository_1.OverwriteMode.FailIfExists; } + return __awaiter(this, void 0, void 0, function () { + function uploadPackage(filePath) { + return __awaiter(this, void 0, void 0, function () { + var buffer, fileName; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, readFile(filePath)]; + case 1: + buffer = _a.sent(); + fileName = path_1.default.basename(filePath); + console.log("Uploading package, ".concat(fileName, "...")); + return [4 /*yield*/, repository.packages.upload(new File([buffer], fileName), overwriteMode)]; + case 2: + _a.sent(); + return [2 /*return*/]; + } + }); + }); + } + var repository, tasks, _i, packages_1, packagePath; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, (0, connect_1.connect)(space)]; + case 1: + repository = (_a.sent())[0]; + tasks = []; + for (_i = 0, packages_1 = packages; _i < packages_1.length; _i++) { + packagePath = packages_1[_i]; + tasks.push(uploadPackage(packagePath)); + } + return [4 /*yield*/, Promise.all(tasks)]; + case 2: + _a.sent(); + console.log("Packages uploaded"); + return [2 /*return*/]; + } + }); + }); +} +exports.pushPackage = pushPackage; + + +/***/ }), + +/***/ 70347: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.throwIfUndefined = void 0; +var could_not_find_error_1 = __nccwpck_require__(62407); +function throwIfUndefined( +// eslint-disable-next-line no-shadow +findPromise, getPromise, resourceTypeIdPrefix, resourceTypeDisplayName, nameOrId, enclosingContextDescription, skipLog) { + if (enclosingContextDescription === void 0) { enclosingContextDescription = ""; } + if (skipLog === void 0) { skipLog = false; } + return __awaiter(this, void 0, void 0, function () { + var escapeRegExp, resourceById, _a, resourceByName, _b, found; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + escapeRegExp = function (text) { + return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + }; + if (!!new RegExp("^".concat(escapeRegExp(resourceTypeIdPrefix), "-/d+$")).test(nameOrId)) return [3 /*break*/, 1]; + resourceById = undefined; + return [3 /*break*/, 4]; + case 1: + _c.trys.push([1, 3, , 4]); + return [4 /*yield*/, getPromise(nameOrId)]; + case 2: + resourceById = _c.sent(); + return [3 /*break*/, 4]; + case 3: + _a = _c.sent(); + resourceById = undefined; + return [3 /*break*/, 4]; + case 4: + _c.trys.push([4, 6, , 7]); + return [4 /*yield*/, findPromise(nameOrId)]; + case 5: + resourceByName = _c.sent(); + return [3 /*break*/, 7]; + case 6: + _b = _c.sent(); + resourceByName = undefined; + return [3 /*break*/, 7]; + case 7: + if (resourceById === undefined && resourceByName === undefined) + throw could_not_find_error_1.CouldNotFindError.createResource(resourceTypeDisplayName, nameOrId, enclosingContextDescription); + if (resourceById !== undefined && resourceByName !== undefined && resourceById.Id !== resourceByName.Id) + throw new Error("Ambiguous ".concat(resourceTypeDisplayName, " reference '").concat(nameOrId, "' matches both '").concat(resourceById.Name, "' (").concat(resourceById.Id, ") and '").concat(resourceByName.Name, "' (").concat(resourceByName.Id, ").")); + found = resourceById !== null && resourceById !== void 0 ? resourceById : resourceByName; + if (found === undefined) { + throw could_not_find_error_1.CouldNotFindError.createResource(resourceTypeDisplayName, nameOrId, enclosingContextDescription); + } + return [2 /*return*/, found]; + } + }); + }); +} +exports.throwIfUndefined = throwIfUndefined; + + +/***/ }), + +/***/ 9507: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AccountRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var AccountRepository = /** @class */ (function (_super) { + __extends(AccountRepository, _super); + function AccountRepository(client) { + return _super.call(this, "Accounts", client) || this; + } + AccountRepository.prototype.getAccountUsages = function (account) { + return this.client.get(account.Links["Usages"]); + }; + AccountRepository.prototype.getFabricApplications = function (account) { + return this.client.get(account.Links["FabricApplications"]); + }; + AccountRepository.prototype.getIsolatedAzureEnvironments = function () { + return this.client.get(this.client.getLink("AzureEnvironments")); + }; + AccountRepository.prototype.getResourceGroups = function (account) { + return this.client.get(account.Links["ResourceGroups"]); + }; + AccountRepository.prototype.getStorageAccounts = function (account) { + return this.client.get(account.Links["StorageAccounts"]); + }; + AccountRepository.prototype.getWebSites = function (account) { + return this.client.get(account.Links["WebSites"]); + }; + AccountRepository.prototype.getWebSiteSlots = function (account, resourceGroupName, webSiteName) { + var args = { resourceGroupName: resourceGroupName, webSiteName: webSiteName }; + return this.client.get(account.Links["WebSiteSlots"], args); + }; + return AccountRepository; +}(basicRepository_1.BasicRepository)); +exports.AccountRepository = AccountRepository; + + +/***/ }), + +/***/ 67895: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ActionTemplateRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var ActionTemplateRepository = /** @class */ (function (_super) { + __extends(ActionTemplateRepository, _super); + function ActionTemplateRepository(client) { + return _super.call(this, "ActionTemplates", client) || this; + } + ActionTemplateRepository.prototype.categories = function () { + return this.client.get(this.client.getLink("ActionTemplatesCategories")); + }; + ActionTemplateRepository.prototype.getByCommunityTemplate = function (communityTemplate) { + var allArgs = __assign({}, { id: communityTemplate.Id }); + return this.client.get(communityTemplate.Links["InstalledTemplate"], allArgs); + }; + ActionTemplateRepository.prototype.getUsage = function (template) { + return this.client.get(template.Links["Usage"]); + }; + ActionTemplateRepository.prototype.getVersion = function (actionTemplate, version) { + return this.client.get(actionTemplate.Links["Versions"], { version: version }); + }; + ActionTemplateRepository.prototype.search = function (args) { + return this.client.get(this.client.getLink("ActionTemplatesSearch"), args); + }; + ActionTemplateRepository.prototype.updateActions = function (actionTemplate, actionsToUpdate, defaults, overrides) { + if (defaults === void 0) { defaults = {}; } + if (overrides === void 0) { overrides = {}; } + var resource = { + ActionsToUpdate: actionsToUpdate, + Overrides: overrides || {}, + DefaultPropertyValues: defaults || {}, + Version: actionTemplate.Version, + }; + return this.client.post(actionTemplate.Links["ActionsUpdate"], resource); + }; + return ActionTemplateRepository; +}(basicRepository_1.BasicRepository)); +exports.ActionTemplateRepository = ActionTemplateRepository; + + +/***/ }), + +/***/ 89463: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ArtifactRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var ArtifactRepository = /** @class */ (function (_super) { + __extends(ArtifactRepository, _super); + function ArtifactRepository(client) { + return _super.call(this, "Artifacts", client) || this; + } + return ArtifactRepository; +}(basicRepository_1.BasicRepository)); +exports.ArtifactRepository = ArtifactRepository; + + +/***/ }), + +/***/ 42583: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AuthenticationRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var AuthenticationRepository = /** @class */ (function (_super) { + __extends(AuthenticationRepository, _super); + function AuthenticationRepository(client) { + return _super.call(this, "Authentication", client) || this; + } + AuthenticationRepository.prototype.get = function () { + return this.client.get(this.client.getLink("Authentication")); + }; + AuthenticationRepository.prototype.wasLoginInitiated = function (encodedQueryString) { + return this.client.post(this.client.getLink("LoginInitiated"), { EncodedQueryString: encodedQueryString }); + }; + return AuthenticationRepository; +}(basicRepository_1.BasicRepository)); +exports.AuthenticationRepository = AuthenticationRepository; + + +/***/ }), + +/***/ 30970: +/***/ (function(__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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BasicRepository = void 0; +var lodash_1 = __nccwpck_require__(90250); +// Repositories provide a helpful abstraction around the Octopus Deploy API +var BasicRepository = /** @class */ (function () { + function BasicRepository(collectionLinkName, client) { + var _this = this; + this.takeAll = 2147483647; + this.takeDefaultPageSize = 30; + this.notifySubscribersToDataModifications = function (resource) { + Object.keys(_this.subscribersToDataModifications).forEach(function (key) { return _this.subscribersToDataModifications[key](resource); }); + return resource; + }; + this.collectionLinkName = collectionLinkName; + this.client = client; + this.subscribersToDataModifications = {}; + } + BasicRepository.prototype.all = function (args) { + if (args !== undefined && args.ids instanceof Array && args.ids.length === 0) { + return new Promise(function (res) { + res([]); + }); + } + // http.sys has a max query string of about 16k chars. Our typical max id length is 50 chars + // so if we are doing requests by id and have more than 300, split into multiple requests + var maxIds = 300; + if (args !== undefined && args.ids instanceof Array && args.ids.length > maxIds) { + return this.batchRequestsById(args, maxIds); + } + var allArgs = this.extend(args || {}, { id: "all" }); + return this.client.get(this.client.getLink(this.collectionLinkName), allArgs); + }; + BasicRepository.prototype.allById = function (args) { + return this.all(args).then(function (result) { + return result.reduce(function (acc, resource) { + acc[resource.Id] = resource; + return acc; + }, {}); + }); + }; + BasicRepository.prototype.del = function (resource) { + var _this = this; + return this.client.del(resource.Links.Self).then(function (d) { return _this.notifySubscribersToDataModifications(resource); }); + }; + BasicRepository.prototype.create = function (resource, args) { + var _this = this; + return this.client + .create(this.client.getLink(this.collectionLinkName), resource, args) + .then(function (r) { return _this.notifySubscribersToDataModifications(r); }); + }; + BasicRepository.prototype.get = function (id, args) { + var allArgs = this.extend(args || {}, { id: id }); + return this.client.get(this.client.getLink(this.collectionLinkName), allArgs); + }; + BasicRepository.prototype.list = function (args) { + return this.client.get(this.client.getLink(this.collectionLinkName), args); + }; + BasicRepository.prototype.modify = function (resource, args) { + var _this = this; + return this.client.update(resource.Links.Self, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); + }; + BasicRepository.prototype.save = function (resource) { + if (isNewResource(resource)) { + return this.create(resource); + } + else { + return this.modify(resource); + } + function isTruthy(value) { + return !!value; + } + function isNewResource(resource) { + return !("Id" in resource && isTruthy(resource.Id) && isTruthy(resource.Links)); + } + }; + BasicRepository.prototype.subscribeToDataModifications = function (key, callback) { + this.subscribersToDataModifications[key] = callback; + }; + BasicRepository.prototype.unsubscribeFromDataModifications = function (key) { + delete this.subscribersToDataModifications[key]; + }; + BasicRepository.prototype.extend = function (arg1, arg2) { + return __assign(__assign({}, arg1), arg2); + }; + BasicRepository.prototype.batchRequestsById = function (args, batchSize) { + var _this = this; + var idArrays = (0, lodash_1.chunk)(args.ids, batchSize); + var promises = idArrays.map(function (ids) { + var newArgs = __assign(__assign({}, args), { ids: ids, id: "all" }); + return _this.client.get(_this.client.getLink(_this.collectionLinkName), newArgs); + }); + return Promise.all(promises).then(function (result) { return (0, lodash_1.flatten)(result); }); + }; + return BasicRepository; +}()); +exports.BasicRepository = BasicRepository; + + +/***/ }), + +/***/ 15835: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BranchesRepository = void 0; +var BranchesRepository = /** @class */ (function () { + function BranchesRepository(client) { + this.client = client; + this.client = client; + } + BranchesRepository.prototype.getTemplate = function (branch, channelId) { + return this.client.get(branch.Links["ReleaseTemplate"], { channel: channelId }); + }; + return BranchesRepository; +}()); +exports.BranchesRepository = BranchesRepository; + + +/***/ }), + +/***/ 7946: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BuildInformationRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var BuildInformationRepository = /** @class */ (function (_super) { + __extends(BuildInformationRepository, _super); + function BuildInformationRepository(client) { + return _super.call(this, "BuildInformation", client) || this; + } + BuildInformationRepository.prototype.deleteMany = function (ids) { + return this.client.del(this.client.getLink("BuildInformationBulk"), null, { ids: ids }); + }; + return BuildInformationRepository; +}(basicRepository_1.BasicRepository)); +exports.BuildInformationRepository = BuildInformationRepository; + + +/***/ }), + +/***/ 4776: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CertificateConfigurationRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var CertificateConfigurationRepository = /** @class */ (function (_super) { + __extends(CertificateConfigurationRepository, _super); + function CertificateConfigurationRepository(client) { + return _super.call(this, "CertificateConfiguration", client) || this; + } + CertificateConfigurationRepository.prototype.archive = function (certificate) { + return this.client.post(certificate.Links["Archive"]); + }; + CertificateConfigurationRepository.prototype.export = function (certificate, exportOptions) { + return this.client.get(certificate.Links["Export"], exportOptions); + }; + CertificateConfigurationRepository.prototype.global = function () { + return this.get("certificate-global"); + }; + CertificateConfigurationRepository.prototype.replace = function (certificate, newCertificateData, newPassword) { + return this.client.post(certificate.Links["Replace"], { + certificateData: newCertificateData, + password: newPassword, + }); + }; + CertificateConfigurationRepository.prototype.usage = function (certificate) { + return this.client.get(certificate.Links["Usages"]); + }; + CertificateConfigurationRepository.prototype.unarchive = function (certificate) { + return this.client.post(certificate.Links["Unarchive"]); + }; + return CertificateConfigurationRepository; +}(basicRepository_1.BasicRepository)); +exports.CertificateConfigurationRepository = CertificateConfigurationRepository; + + +/***/ }), + +/***/ 41266: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CertificateRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var SelfSignedEndpoint = "/generate"; +var CertificateRepository = /** @class */ (function (_super) { + __extends(CertificateRepository, _super); + function CertificateRepository(client) { + return _super.call(this, "Certificates", client) || this; + } + CertificateRepository.prototype.createSelfSigned = function (resource, args) { + var _this = this; + return this.client.create(this.client.getLink("Certificates") + SelfSignedEndpoint, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); + }; + CertificateRepository.prototype.listForTenant = function (tenantId) { + return __awaiter(this, void 0, void 0, function () { + var certificates; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.list({ tenant: tenantId, take: this.takeAll })]; + case 1: + certificates = (_a.sent()).Items; + return [2 /*return*/, certificates]; + } + }); + }); + }; + CertificateRepository.prototype.names = function (projectId, projectEnvironmentsFilter) { + return this.client.get(this.client.getLink("VariableNames"), { + project: projectId, + projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, + }); + }; + CertificateRepository.prototype.saveSelfSigned = function (resource) { + if (isExistingResource(resource)) { + return this.modify(resource); + } + else { + return this.createSelfSigned(resource); + } + function isExistingResource(r) { + return !!r.Links && !!r.Id; + } + }; + return CertificateRepository; +}(basicRepository_1.BasicRepository)); +exports.CertificateRepository = CertificateRepository; + + +/***/ }), + +/***/ 94659: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ChannelRepository = void 0; +var projectScopedRepository_1 = __nccwpck_require__(91795); +var ChannelRepository = /** @class */ (function (_super) { + __extends(ChannelRepository, _super); + function ChannelRepository(projectRepository, client) { + return _super.call(this, projectRepository, "Channels", client) || this; + } + ChannelRepository.prototype.find = function (nameOrId) { + return __awaiter(this, void 0, void 0, function () { + var _a, channels; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (nameOrId.length === 0) + return [2 /*return*/]; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.get(nameOrId)]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: + _a = _b.sent(); + return [3 /*break*/, 4]; + case 4: return [4 /*yield*/, this.list({ + partialName: nameOrId, + })]; + case 5: + channels = _b.sent(); + return [2 /*return*/, channels.Items.find(function (e) { return e.Name.localeCompare(nameOrId, undefined, { sensitivity: "base" }) === 0; })]; + } + }); + }); + }; + ChannelRepository.prototype.ruleTest = function (searchOptions) { + return this.client.post(this.client.getLink("VersionRuleTest"), searchOptions); + }; + ChannelRepository.prototype.getReleases = function (channel, options) { + return this.client.get(channel.Links["Releases"], options); + }; + ChannelRepository.prototype.getOcl = function (channel) { + return this.client.get(channel.Links["RawOcl"]); + }; + ChannelRepository.prototype.modifyOcl = function (channel, command) { + return this.client.update(channel.Links["RawOcl"], command); + }; + ChannelRepository.prototype.modify = function (channel, args) { + var payload = channel; + this.addCommitMessage(payload, args); + if (payload !== undefined) { + return this.client.update(channel.Links.Self, payload); + } + else { + return _super.prototype.modify.call(this, channel, args); + } + }; + ChannelRepository.prototype.createForProject = function (projectResource, channel, args) { + var _this = this; + var payload = channel; + this.addCommitMessage(payload, args); + if (payload !== undefined) { + var link = projectResource.Links[this.collectionLinkName]; + return this.client.create(link, payload, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); + } + else { + return _super.prototype.createForProject.call(this, projectResource, channel, args); + } + }; + ChannelRepository.prototype.addCommitMessage = function (command, args) { + if (args !== undefined && "gitRef" in args && "commitMessage" in args) { + command.ChangeDescription = args["commitMessage"]; + } + }; + return ChannelRepository; +}(projectScopedRepository_1.ProjectScopedRepository)); +exports.ChannelRepository = ChannelRepository; + + +/***/ }), + +/***/ 94203: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CloudTemplateRepository = void 0; +var CloudTemplateRepository = /** @class */ (function () { + function CloudTemplateRepository(client) { + this.client = client; + } + CloudTemplateRepository.prototype.getMetadata = function (templateBody, id) { + var templateResource = { template: encodeURI(templateBody) }; + return this.client.post(this.client.getLink("CloudTemplate"), templateResource, { id: id.toString() }); + }; + return CloudTemplateRepository; +}()); +exports.CloudTemplateRepository = CloudTemplateRepository; + + +/***/ }), + +/***/ 69039: +/***/ (function(__unused_webpack_module, exports) { + +"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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.CommunityActionTemplateRepository = void 0; +var CommunityActionTemplateRepository = /** @class */ (function () { + function CommunityActionTemplateRepository(client) { + this.client = client; + } + CommunityActionTemplateRepository.prototype.get = function (id) { + var allArgs = __assign({}, { id: id }); + return this.client.get(this.client.getLink("CommunityActionTemplates"), allArgs); + }; + CommunityActionTemplateRepository.prototype.install = function (communityActionTemplate) { + return this.client.post(communityActionTemplate.Links["Installation"]); + }; + CommunityActionTemplateRepository.prototype.updateInstallation = function (communityActionTemplate) { + return this.client.put(communityActionTemplate.Links["Installation"]); + }; + return CommunityActionTemplateRepository; +}()); +exports.CommunityActionTemplateRepository = CommunityActionTemplateRepository; + + +/***/ }), + +/***/ 13497: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConfigurationRepository = void 0; +var ConfigurationRepository = /** @class */ (function () { + function ConfigurationRepository(configurationLinkName, client) { + this.configurationLinkName = configurationLinkName; + this.client = client; + } + ConfigurationRepository.prototype.get = function () { + return this.client.get(this.client.getLink(this.configurationLinkName)); + }; + ConfigurationRepository.prototype.modify = function (resource) { + return this.client.update(resource.Links["Self"], resource); + }; + return ConfigurationRepository; +}()); +exports.ConfigurationRepository = ConfigurationRepository; + + +/***/ }), + +/***/ 66446: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DashboardConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var DashboardConfigurationRepository = /** @class */ (function (_super) { + __extends(DashboardConfigurationRepository, _super); + function DashboardConfigurationRepository(client) { + return _super.call(this, "DashboardConfiguration", client) || this; + } + return DashboardConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.DashboardConfigurationRepository = DashboardConfigurationRepository; + + +/***/ }), + +/***/ 20009: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DashboardItemsOptions = exports.DashboardRepository = void 0; +var DashboardRepository = /** @class */ (function () { + function DashboardRepository(client) { + this.client = client; + } + DashboardRepository.prototype.getDeploymentsCountedByWeek = function (projectIds) { + return this.client.get(this.client.getLink("Reporting/DeploymentsCountedByWeek"), { projectIds: projectIds.join(",") }); + }; + DashboardRepository.prototype.getDashboard = function (dashboardFilter) { + return this.client.get(this.client.getLink("Dashboard"), dashboardFilter); + }; + DashboardRepository.prototype.getDynamicDashboard = function (projects, environments, dashboardItemsOptions) { + if (dashboardItemsOptions === void 0) { dashboardItemsOptions = DashboardItemsOptions.IncludeCurrentDeploymentOnly; } + return this.client.get(this.client.getLink("DashboardDynamic"), { + projects: projects, + environments: environments, + includePrevious: dashboardItemsOptions === DashboardItemsOptions.IncludeCurrentAndPreviousSuccessfulDeployment, + }); + }; + return DashboardRepository; +}()); +exports.DashboardRepository = DashboardRepository; +var DashboardItemsOptions; +(function (DashboardItemsOptions) { + DashboardItemsOptions[DashboardItemsOptions["IncludeCurrentDeploymentOnly"] = 0] = "IncludeCurrentDeploymentOnly"; + DashboardItemsOptions[DashboardItemsOptions["IncludeCurrentAndPreviousSuccessfulDeployment"] = 1] = "IncludeCurrentAndPreviousSuccessfulDeployment"; +})(DashboardItemsOptions = exports.DashboardItemsOptions || (exports.DashboardItemsOptions = {})); + + +/***/ }), + +/***/ 81630: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DefectRepository = void 0; +var DefectRepository = /** @class */ (function () { + function DefectRepository(client) { + this.client = client; + } + DefectRepository.prototype.all = function (release) { + return this.client.get(release.Links["Defects"]); + }; + DefectRepository.prototype.report = function (release, description) { + return this.client.post(release.Links["ReportDefect"], { Description: description }); + }; + DefectRepository.prototype.resolve = function (release) { + return this.client.post(release.Links["ResolveDefect"]); + }; + return DefectRepository; +}()); +exports.DefectRepository = DefectRepository; + + +/***/ }), + +/***/ 82773: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DeploymentProcessRepository = void 0; +var projectScopedRepository_1 = __nccwpck_require__(91795); +var DeploymentProcessRepository = /** @class */ (function (_super) { + __extends(DeploymentProcessRepository, _super); + function DeploymentProcessRepository(projectRepository, client) { + var _this = _super.call(this, projectRepository, "DeploymentProcesses", client) || this; + _this.resourceLink = "DeploymentProcess"; + _this.collectionLink = "DeploymentProcesses"; + return _this; + } + DeploymentProcessRepository.prototype.get = function (id, gitRef) { + return _super.prototype.get.call(this, id, { gitRef: gitRef }); + }; + DeploymentProcessRepository.prototype.getForRelease = function (release) { + return this.client.get(this.client.getLink(this.collectionLink), { id: release.ProjectDeploymentProcessSnapshotId }); + }; + DeploymentProcessRepository.prototype.getTemplate = function (deploymentProcess, channel, releaseId) { + return this.client.get(deploymentProcess.Links["Template"], { channel: channel === null || channel === void 0 ? void 0 : channel.Id, releaseId: releaseId }); + }; + DeploymentProcessRepository.prototype.modify = function (deploymentProcess) { + return this.client.update(deploymentProcess.Links.Self, deploymentProcess); + }; + DeploymentProcessRepository.prototype.validate = function (deploymentProcess) { + return this.client.post(deploymentProcess.Links["Validation"], __assign({}, deploymentProcess)); + }; + DeploymentProcessRepository.prototype.getOcl = function (deploymentProcess) { + return this.client.get(deploymentProcess.Links["RawOcl"]); + }; + DeploymentProcessRepository.prototype.modifyOcl = function (deploymentProcess, command) { + return this.client.update(deploymentProcess.Links["RawOcl"], command); + }; + return DeploymentProcessRepository; +}(projectScopedRepository_1.ProjectScopedRepository)); +exports.DeploymentProcessRepository = DeploymentProcessRepository; + + +/***/ }), + +/***/ 91848: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DeploymentRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var DeploymentRepository = /** @class */ (function (_super) { + __extends(DeploymentRepository, _super); + function DeploymentRepository(client) { + return _super.call(this, "Deployments", client) || this; + } + return DeploymentRepository; +}(basicRepository_1.BasicRepository)); +exports.DeploymentRepository = DeploymentRepository; + + +/***/ }), + +/***/ 98936: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DeploymentSettingsRepository = void 0; +var DeploymentSettingsRepository = /** @class */ (function () { + function DeploymentSettingsRepository(client, project, branch) { + this.client = client; + this.project = project; + this.branch = branch; + this.resourceLink = "DeploymentSettings"; + this.client = client; + } + DeploymentSettingsRepository.prototype.get = function () { + if (this.project.IsVersionControlled && this.branch !== undefined) { + return this.client.get(this.branch.Links[this.resourceLink]); + } + return this.client.get(this.project.Links[this.resourceLink]); + }; + DeploymentSettingsRepository.prototype.getOcl = function (deploymentSettings) { + return this.client.get(deploymentSettings.Links["RawOcl"]); + }; + DeploymentSettingsRepository.prototype.modify = function (deploymentSettings) { + return this.client.update(deploymentSettings.Links.Self, deploymentSettings); + }; + DeploymentSettingsRepository.prototype.modifyOcl = function (deploymentSettings, command) { + return this.client.update(deploymentSettings.Links["RawOcl"], command); + }; + return DeploymentSettingsRepository; +}()); +exports.DeploymentSettingsRepository = DeploymentSettingsRepository; + + +/***/ }), + +/***/ 27848: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DynamicExtensionRepository = void 0; +var DynamicExtensionRepository = /** @class */ (function () { + function DynamicExtensionRepository(client) { + this.client = client; + } + DynamicExtensionRepository.prototype.getFeaturesMetadata = function () { + return this.client.get(this.client.getLink("DynamicExtensionsFeaturesMetadata")); + }; + DynamicExtensionRepository.prototype.getFeaturesValues = function () { + return this.client.get(this.client.getLink("DynamicExtensionsFeaturesValues")); + }; + DynamicExtensionRepository.prototype.getScripts = function () { + return this.client.get(this.client.getLink("DynamicExtensionsScripts")); + }; + DynamicExtensionRepository.prototype.putFeaturesValues = function (values) { + return this.client.put(this.client.getLink("DynamicExtensionsFeaturesValues"), values); + }; + return DynamicExtensionRepository; +}()); +exports.DynamicExtensionRepository = DynamicExtensionRepository; + + +/***/ }), + +/***/ 8183: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EnvironmentRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var EnvironmentRepository = /** @class */ (function (_super) { + __extends(EnvironmentRepository, _super); + function EnvironmentRepository(client) { + return _super.call(this, "Environments", client) || this; + } + EnvironmentRepository.prototype.find = function (namesOrIds) { + return __awaiter(this, void 0, void 0, function () { + var environments, matchingEnvironments, _a, _loop_1, this_1, _i, namesOrIds_1, name_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (namesOrIds.length === 0) + return [2 /*return*/, []]; + environments = []; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.list({ + ids: namesOrIds, + })]; + case 2: + matchingEnvironments = _b.sent(); + environments.push.apply(environments, matchingEnvironments.Items); + return [3 /*break*/, 4]; + case 3: + _a = _b.sent(); + return [3 /*break*/, 4]; + case 4: + _loop_1 = function (name_1) { + var matchingEnvironments; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [4 /*yield*/, this_1.list({ + name: name_1, + })]; + case 1: + matchingEnvironments = _c.sent(); + environments.push.apply(environments, matchingEnvironments.Items.filter(function (e) { return e.Name.localeCompare(name_1, undefined, { sensitivity: 'base' }) === 0; })); + return [2 /*return*/]; + } + }); + }; + this_1 = this; + _i = 0, namesOrIds_1 = namesOrIds; + _b.label = 5; + case 5: + if (!(_i < namesOrIds_1.length)) return [3 /*break*/, 8]; + name_1 = namesOrIds_1[_i]; + return [5 /*yield**/, _loop_1(name_1)]; + case 6: + _b.sent(); + _b.label = 7; + case 7: + _i++; + return [3 /*break*/, 5]; + case 8: return [2 /*return*/, environments]; + } + }); + }); + }; + EnvironmentRepository.prototype.getMetadata = function (environment) { + return this.client.get(environment.Links["Metadata"], {}); + }; + EnvironmentRepository.prototype.sort = function (order) { + return this.client.put(this.client.getLink("EnvironmentSortOrder"), order); + }; + EnvironmentRepository.prototype.summary = function (args) { + return this.client.get(this.client.getLink("EnvironmentsSummary"), args); + }; + EnvironmentRepository.prototype.machines = function (environment, args) { + return this.client.get(environment.Links["Machines"], args); + }; + EnvironmentRepository.prototype.variablesScopedOnlyToThisEnvironment = function (environment) { + return this.client.get(environment.Links["SinglyScopedVariableDetails"]); + }; + return EnvironmentRepository; +}(basicRepository_1.BasicRepository)); +exports.EnvironmentRepository = EnvironmentRepository; + + +/***/ }), + +/***/ 65269: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EventRepository = void 0; +var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); +var EventRepository = /** @class */ (function (_super) { + __extends(EventRepository, _super); + function EventRepository(client) { + return _super.call(this, "Events", client) || this; + } + EventRepository.prototype.categories = function (options) { + return this.client.get(this.client.getLink("EventCategories"), options); + }; + EventRepository.prototype.groups = function (options) { + return this.client.get(this.client.getLink("EventGroups"), options); + }; + EventRepository.prototype.documentTypes = function (options) { + return this.client.get(this.client.getLink("EventDocumentTypes"), options); + }; + EventRepository.prototype.eventAgents = function () { + return this.client.get(this.client.getLink("EventAgents")); + }; + return EventRepository; +}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); +exports.EventRepository = EventRepository; + + +/***/ }), + +/***/ 22999: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExternalSecurityGroupProviderRepository = void 0; +var ExternalSecurityGroupProviderRepository = /** @class */ (function () { + function ExternalSecurityGroupProviderRepository(client) { + this.client = client; + } + ExternalSecurityGroupProviderRepository.prototype.all = function () { + return this.client.get(this.client.getLink("ExternalSecurityGroupProviders")); + }; + return ExternalSecurityGroupProviderRepository; +}()); +exports.ExternalSecurityGroupProviderRepository = ExternalSecurityGroupProviderRepository; + + +/***/ }), + +/***/ 4387: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExternalSecurityGroupRepository = void 0; +var ExternalSecurityGroupRepository = /** @class */ (function () { + function ExternalSecurityGroupRepository(client) { + this.client = client; + } + ExternalSecurityGroupRepository.prototype.search = function (url, partialName) { + return this.client.get(url, { partialName: partialName }); + }; + return ExternalSecurityGroupRepository; +}()); +exports.ExternalSecurityGroupRepository = ExternalSecurityGroupRepository; + + +/***/ }), + +/***/ 55459: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExternalUsersRepository = void 0; +var ExternalUsersRepository = /** @class */ (function () { + function ExternalUsersRepository(client) { + this.client = client; + } + ExternalUsersRepository.prototype.search = function (partialName) { + return this.client.get(this.client.getLink("ExternalUserSearch"), { partialName: partialName }); + }; + ExternalUsersRepository.prototype.searchProvider = function (providerUrl, partialName) { + return this.client.get(providerUrl, { partialName: partialName }); + }; + return ExternalUsersRepository; +}()); +exports.ExternalUsersRepository = ExternalUsersRepository; + + +/***/ }), + +/***/ 56116: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FeaturesConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var FeaturesConfigurationRepository = /** @class */ (function (_super) { + __extends(FeaturesConfigurationRepository, _super); + function FeaturesConfigurationRepository(client) { + return _super.call(this, "FeaturesConfiguration", client) || this; + } + return FeaturesConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.FeaturesConfigurationRepository = FeaturesConfigurationRepository; + + +/***/ }), + +/***/ 20037: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/consistent-type-assertions */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FeedRepository = exports.ExternalFeedsFilterTypes = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var basicRepository_1 = __nccwpck_require__(30970); +var ExternalFeedsFilterTypes = /** @class */ (function () { + function ExternalFeedsFilterTypes() { + } + Object.defineProperty(ExternalFeedsFilterTypes, "defaultFilterTypes", { + get: function () { + return this._defaultFilterTypes; + }, + enumerable: false, + configurable: true + }); + ExternalFeedsFilterTypes._defaultFilterTypes = Object.keys(message_contracts_1.FeedType) + .filter(function (f) { return f !== message_contracts_1.FeedType.BuiltIn && f !== message_contracts_1.FeedType.OctopusProject; }) + .map(function (f) { return f; }); + return ExternalFeedsFilterTypes; +}()); +exports.ExternalFeedsFilterTypes = ExternalFeedsFilterTypes; +var FeedRepository = /** @class */ (function (_super) { + __extends(FeedRepository, _super); + function FeedRepository(client) { + return _super.call(this, "Feeds", client) || this; + } + FeedRepository.prototype.getBuiltIn = function () { + return __awaiter(this, void 0, void 0, function () { + var result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.client.get(this.client.getLink("Feeds"), { feedType: message_contracts_1.FeedType.BuiltIn })]; + case 1: + result = _a.sent(); + return [2 /*return*/, result.Items[0]]; + } + }); + }); + }; + FeedRepository.prototype.getOctopusProject = function () { + return __awaiter(this, void 0, void 0, function () { + var result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.client.get(this.client.getLink("Feeds"), { feedType: message_contracts_1.FeedType.OctopusProject })]; + case 1: + result = _a.sent(); + return [2 /*return*/, result.Items[0]]; + } + }); + }); + }; + FeedRepository.prototype.getBuiltInStatus = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, this.client.get(this.client.getLink("BuiltInFeedStats"))]; + }); + }); + }; + FeedRepository.prototype.listExternal = function () { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, this.client.get(this.client.getLink("Feeds"), { feedType: ExternalFeedsFilterTypes.defaultFilterTypes })]; + }); + }); + }; + FeedRepository.prototype.searchPackages = function (feed, searchOptions) { + return this.client.get(feed.Links.SearchPackagesTemplate, searchOptions); + }; + FeedRepository.prototype.searchPackageVersions = function (feed, packageId, searchOptions) { + return this.client.get(feed.Links["SearchPackageVersionsTemplate"], __assign({ packageId: packageId }, searchOptions)); + }; + FeedRepository.prototype.getNotes = function (feed, packageId, version) { + return this.client.getRaw(feed.Links["NotesTemplate"], { packageId: packageId, version: version }); + }; + return FeedRepository; +}(basicRepository_1.BasicRepository)); +exports.FeedRepository = FeedRepository; + + +/***/ }), + +/***/ 18029: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ImportExportActions = void 0; +var ImportExportActions = /** @class */ (function () { + function ImportExportActions(client) { + this.client = client; + } + ImportExportActions.prototype.export = function (exportRequest) { + return this.client.post(this.client.getLink("ExportProjects"), exportRequest); + }; + ImportExportActions.prototype.files = function () { + return this.client.get(this.client.getLink("ProjectImportFiles")); + }; + ImportExportActions.prototype.import = function (importRequest) { + return this.client.post(this.client.getLink("ImportProjects"), importRequest); + }; + ImportExportActions.prototype.preview = function (importRequest) { + return this.client.post(this.client.getLink("ProjectImportPreview"), importRequest); + }; + ImportExportActions.prototype.upload = function (pkg) { + var fd = new FormData(); + fd.append("fileToUpload", pkg); + return this.client.post(this.client.getLink("ProjectImportFiles"), fd); + }; + return ImportExportActions; +}()); +exports.ImportExportActions = ImportExportActions; + + +/***/ }), + +/***/ 90977: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InterruptionRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var InterruptionRepository = /** @class */ (function (_super) { + __extends(InterruptionRepository, _super); + function InterruptionRepository(client) { + return _super.call(this, "Interruptions", client) || this; + } + InterruptionRepository.prototype.submit = function (interruption, result) { + return this.client.post(interruption.Links["Submit"], result); + }; + InterruptionRepository.prototype.takeResponsibility = function (interruption) { + return this.client.put(interruption.Links["Responsible"]); + }; + return InterruptionRepository; +}(basicRepository_1.BasicRepository)); +exports.InterruptionRepository = InterruptionRepository; + + +/***/ }), + +/***/ 15228: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InvitationRepository = void 0; +var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); +var InvitationRepository = /** @class */ (function (_super) { + __extends(InvitationRepository, _super); + function InvitationRepository(client) { + return _super.call(this, "Invitations", client) || this; + } + InvitationRepository.prototype.invite = function (teamIds, spaceId) { + return this.client.post(this.client.getLink("Invitations"), { AddToTeamIds: teamIds, SpaceId: spaceId }); + }; + return InvitationRepository; +}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); +exports.InvitationRepository = InvitationRepository; + + +/***/ }), + +/***/ 78681: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LetsEncryptConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var LetsEncryptConfigurationRepository = /** @class */ (function (_super) { + __extends(LetsEncryptConfigurationRepository, _super); + function LetsEncryptConfigurationRepository(client) { + return _super.call(this, "LetsEncryptConfiguration", client) || this; + } + return LetsEncryptConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.LetsEncryptConfigurationRepository = LetsEncryptConfigurationRepository; + + +/***/ }), + +/***/ 64693: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LibraryVariableRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var LibraryVariableRepository = /** @class */ (function (_super) { + __extends(LibraryVariableRepository, _super); + function LibraryVariableRepository(client) { + return _super.call(this, "LibraryVariables", client) || this; + } + LibraryVariableRepository.prototype.getUsages = function (libraryVariableSet) { + return this.client.get(libraryVariableSet.Links["Usages"]); + }; + return LibraryVariableRepository; +}(basicRepository_1.BasicRepository)); +exports.LibraryVariableRepository = LibraryVariableRepository; + + +/***/ }), + +/***/ 51916: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LicenseRepository = void 0; +var LicenseRepository = /** @class */ (function () { + function LicenseRepository(client) { + this.client = client; + } + LicenseRepository.prototype.getCurrent = function () { + return this.client.get(this.client.getLink("CurrentLicense")); + }; + LicenseRepository.prototype.getCurrentStatus = function () { + return this.client.get(this.client.getLink("CurrentLicenseStatus")); + }; + LicenseRepository.prototype.modifyCurrent = function (resource) { + return this.client.update(resource.Links.Self, resource); + }; + return LicenseRepository; +}()); +exports.LicenseRepository = LicenseRepository; + + +/***/ }), + +/***/ 56946: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.LifecycleRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var LifecycleRepository = /** @class */ (function (_super) { + __extends(LifecycleRepository, _super); + function LifecycleRepository(client) { + return _super.call(this, "Lifecycles", client) || this; + } + LifecycleRepository.prototype.preview = function (lifecycle) { + return this.client.get(lifecycle.Links["Preview"]); + }; + LifecycleRepository.prototype.projects = function (lifecycle) { + return this.client.get(lifecycle.Links["Projects"]); + }; + return LifecycleRepository; +}(basicRepository_1.BasicRepository)); +exports.LifecycleRepository = LifecycleRepository; + + +/***/ }), + +/***/ 3522: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.saveLogo = exports.uploadLogo = void 0; +function uploadLogo(client, resource, logo) { + var fd = new FormData(); + fd.append("fileToUpload", logo); + return client.post(resource.Links["Logo"], fd); +} +exports.uploadLogo = uploadLogo; +function saveLogo(client, resource, file, reset) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + // Important: when using saveLogo + // We upload the logo first so that when we do the model save we get back a new url for logo + if (file) { + return [2 /*return*/, uploadLogo(client, resource, file)]; + } + else if (reset) { + return [2 /*return*/, uploadLogo(client, resource, null)]; + } + return [2 /*return*/]; + }); + }); +} +exports.saveLogo = saveLogo; + + +/***/ }), + +/***/ 154: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MachinePolicyRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var MachinePolicyRepository = /** @class */ (function (_super) { + __extends(MachinePolicyRepository, _super); + function MachinePolicyRepository(client) { + return _super.call(this, "MachinePolicies", client) || this; + } + MachinePolicyRepository.prototype.getTemplate = function () { + return this.client.get(this.client.getLink("MachinePolicyTemplate")); + }; + MachinePolicyRepository.prototype.getMachines = function (machinePolicy) { + return this.client.get(machinePolicy.Links["Machines"]); + }; + MachinePolicyRepository.prototype.getWorkers = function (machinePolicy) { + return this.client.get(machinePolicy.Links["Workers"]); + }; + return MachinePolicyRepository; +}(basicRepository_1.BasicRepository)); +exports.MachinePolicyRepository = MachinePolicyRepository; + + +/***/ }), + +/***/ 53015: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MachineRepository = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var basicRepository_1 = __nccwpck_require__(30970); +var MachineRepository = /** @class */ (function (_super) { + __extends(MachineRepository, _super); + function MachineRepository(client) { + return _super.call(this, "Machines", client) || this; + } + MachineRepository.prototype.discover = function (host, port, type, proxyId) { + return proxyId ? this.client.get(this.client.getLink("DiscoverMachine"), { host: host, port: port, type: type, proxyId: proxyId }) : this.client.get(this.client.getLink("DiscoverMachine"), { host: host, port: port, type: type }); + }; + MachineRepository.prototype.getConnectionStatus = function (machine) { + return this.client.get(machine.Links["Connection"]); + }; + MachineRepository.prototype.getDeployments = function (machine, options) { + return this.client.get(machine.Links["TasksTemplate"], __assign(__assign({}, options), { type: message_contracts_1.DeploymentTargetTaskType.Deployment })); + }; + MachineRepository.prototype.getRunbookRuns = function (machine, options) { + return this.client.get(machine.Links["TasksTemplate"], __assign(__assign({}, options), { type: message_contracts_1.DeploymentTargetTaskType.RunbookRun })); + }; + MachineRepository.prototype.hosted = function () { + var allArgs = { id: "hosted" }; + return this.client.get(this.client.getLink("Machines"), allArgs); + }; + MachineRepository.prototype.list = function (args) { + return this.client.get(this.client.getLink("Machines"), args); + }; + MachineRepository.prototype.listByDeployment = function (deployment) { + return this.client.get(this.client.getLink("Machines"), { deploymentId: deployment.Id, id: "all" }); + }; + MachineRepository.prototype.listByEnvironment = function (environment) { + return this.client.get(environment.Links["Machines"]); + }; + return MachineRepository; +}(basicRepository_1.BasicRepository)); +exports.MachineRepository = MachineRepository; + + +/***/ }), + +/***/ 50197: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MachineRoleRepository = void 0; +var MachineRoleRepository = /** @class */ (function () { + function MachineRoleRepository(client) { + this.client = client; + } + MachineRoleRepository.prototype.all = function () { + return this.client.get(this.client.getLink("MachineRoles")); + }; + return MachineRoleRepository; +}()); +exports.MachineRoleRepository = MachineRoleRepository; + + +/***/ }), + +/***/ 1939: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MachineShellsRepository = void 0; +var MachineShellsRepository = /** @class */ (function () { + function MachineShellsRepository(client) { + this.client = client; + } + MachineShellsRepository.prototype.all = function () { + return this.client.get(this.client.getLink("MachineShells")); + }; + return MachineShellsRepository; +}()); +exports.MachineShellsRepository = MachineShellsRepository; + + +/***/ }), + +/***/ 94772: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MaintenanceConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var MaintenanceConfigurationRepository = /** @class */ (function (_super) { + __extends(MaintenanceConfigurationRepository, _super); + function MaintenanceConfigurationRepository(client) { + return _super.call(this, "MaintenanceConfiguration", client) || this; + } + return MaintenanceConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.MaintenanceConfigurationRepository = MaintenanceConfigurationRepository; + + +/***/ }), + +/***/ 80891: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.convertToSpacePartitionParameters = exports.MixedScopeBaseRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +// includeSystem is set to true by default, can be overridden by args +var MixedScopeBaseRepository = /** @class */ (function (_super) { + __extends(MixedScopeBaseRepository, _super); + function MixedScopeBaseRepository() { + return _super !== null && _super.apply(this, arguments) || this; + } + MixedScopeBaseRepository.prototype.all = function (args) { + var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); + return _super.prototype.all.call(this, combinedArgs); + }; + MixedScopeBaseRepository.prototype.allById = function (args) { + var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); + return _super.prototype.allById.call(this, combinedArgs); + }; + MixedScopeBaseRepository.prototype.get = function (id, args) { + var allArgs = this.extend(args || {}, { id: id }); + var argsWithSpace = this.extend(allArgs, this.spacePartitionParameters()); + return _super.prototype.get.call(this, id, argsWithSpace); + }; + MixedScopeBaseRepository.prototype.list = function (args) { + var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); + return _super.prototype.list.call(this, combinedArgs); + }; + MixedScopeBaseRepository.prototype.spacePartitionParameters = function () { + return convertToSpacePartitionParameters(this.client.spaceId, true); + }; + return MixedScopeBaseRepository; +}(basicRepository_1.BasicRepository)); +exports.MixedScopeBaseRepository = MixedScopeBaseRepository; +function convertToSpacePartitionParameters(spaceId, includeSystem) { + var spaces = spaceId ? [spaceId] : []; + return { includeSystem: includeSystem, spaces: spaces }; +} +exports.convertToSpacePartitionParameters = convertToSpacePartitionParameters; + + +/***/ }), + +/***/ 34819: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.OctopusServerNodeRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var OctopusServerNodeRepository = /** @class */ (function (_super) { + __extends(OctopusServerNodeRepository, _super); + function OctopusServerNodeRepository(client) { + return _super.call(this, "OctopusServerNodes", client) || this; + } + OctopusServerNodeRepository.prototype.del = function (resource) { + var _this = this; + return this.client.del(resource.Links.Node).then(function (d) { return _this.notifySubscribersToDataModifications(resource); }); + }; + //technically deprecated, as its not called from the UI. + //introduced in 2019.1.0, the code that called it got changed soon after + OctopusServerNodeRepository.prototype.details = function (node) { + return this.client.get(node.Links["Details"]); + }; + OctopusServerNodeRepository.prototype.summary = function () { + return this.client.get(this.client.getLink("OctopusServerClusterSummary")); + }; + return OctopusServerNodeRepository; +}(basicRepository_1.BasicRepository)); +exports.OctopusServerNodeRepository = OctopusServerNodeRepository; + + +/***/ }), + +/***/ 53378: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageRepository = exports.OverwriteMode = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var OverwriteMode; +(function (OverwriteMode) { + OverwriteMode[OverwriteMode["FailIfExists"] = 0] = "FailIfExists"; + OverwriteMode[OverwriteMode["OverwriteExisting"] = 1] = "OverwriteExisting"; + OverwriteMode[OverwriteMode["IgnoreIfExists"] = 2] = "IgnoreIfExists"; +})(OverwriteMode = exports.OverwriteMode || (exports.OverwriteMode = {})); +var PackageRepository = /** @class */ (function (_super) { + __extends(PackageRepository, _super); + function PackageRepository(client) { + return _super.call(this, "Packages", client) || this; + } + PackageRepository.prototype.deleteMany = function (packageIds) { + return this.client.del(this.client.getLink("PackagesBulk"), null, { ids: packageIds }); + }; + PackageRepository.prototype.upload = function (pkg, overwriteMode) { + if (overwriteMode === void 0) { overwriteMode = OverwriteMode.FailIfExists; } + var fd = new FormData(); + fd.append("fileToUpload", pkg); + return this.client.post(this.client.getLink("PackageUpload"), fd, { overwriteMode: overwriteMode }); + }; + PackageRepository.prototype.getNotes = function (packages) { + var packageIds = packages.reduce(function (result, item) { + return result + + (result.length === 0 ? "" : ",") + + encodeURIComponent(item.FeedId) + + ":" + + encodeURIComponent(item.PackageId) + + ":" + + encodeURIComponent(item.Version); + }, ""); + return this.client.get(this.client.getLink("PackageNotesList"), { packageIds: packageIds }); + }; + return PackageRepository; +}(basicRepository_1.BasicRepository)); +exports.PackageRepository = PackageRepository; + + +/***/ }), + +/***/ 21797: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PerformanceConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var PerformanceConfigurationRepository = /** @class */ (function (_super) { + __extends(PerformanceConfigurationRepository, _super); + function PerformanceConfigurationRepository(client) { + return _super.call(this, "PerformanceConfiguration", client) || this; + } + return PerformanceConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.PerformanceConfigurationRepository = PerformanceConfigurationRepository; + + +/***/ }), + +/***/ 97886: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PermissionDescriptionRepository = void 0; +var PermissionDescriptionRepository = /** @class */ (function () { + function PermissionDescriptionRepository(client) { + this.client = client; + } + PermissionDescriptionRepository.prototype.all = function () { + return this.client.get(this.client.getLink("PermissionDescriptions"), null); + }; + return PermissionDescriptionRepository; +}()); +exports.PermissionDescriptionRepository = PermissionDescriptionRepository; + + +/***/ }), + +/***/ 53127: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProgressionRepository = void 0; +var ProgressionRepository = /** @class */ (function () { + function ProgressionRepository(client) { + this.client = client; + } + ProgressionRepository.prototype.getProgression = function (project, options) { + return this.client.get(project.Links["Progression"], options); + }; + ProgressionRepository.prototype.getRunbookProgression = function (runbook, options) { + return this.client.get(runbook.Links["Progression"], options); + }; + ProgressionRepository.prototype.getTaskRunDashboardItemsForProject = function (project, options) { + return this.client.get(project.Links["RunbookTaskRunDashboardItemsTemplate"], options); + }; + ProgressionRepository.prototype.getTaskRunDashboardItemsForRunbook = function (runbook, options) { + return this.client.get(runbook.Links["TaskRunDashboardItemsTemplate"], options); + }; + return ProgressionRepository; +}()); +exports.ProgressionRepository = ProgressionRepository; + + +/***/ }), + +/***/ 38331: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProjectGroupRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var ProjectGroupRepository = /** @class */ (function (_super) { + __extends(ProjectGroupRepository, _super); + function ProjectGroupRepository(client) { + return _super.call(this, "ProjectGroups", client) || this; + } + return ProjectGroupRepository; +}(basicRepository_1.BasicRepository)); +exports.ProjectGroupRepository = ProjectGroupRepository; + + +/***/ }), + +/***/ 52058: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-non-null-assertion,@typescript-eslint/consistent-type-assertions */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UseDefaultBranch = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var basicRepository_1 = __nccwpck_require__(30970); +exports.UseDefaultBranch = { UseDefaultBranch: true }; +var ProjectRepository = /** @class */ (function (_super) { + __extends(ProjectRepository, _super); + function ProjectRepository(client) { + return _super.call(this, "Projects", client) || this; + } + ProjectRepository.prototype.find = function (nameOrId) { + return __awaiter(this, void 0, void 0, function () { + var _a, projects; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (nameOrId.length === 0) + return [2 /*return*/]; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.get(nameOrId)]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: + _a = _b.sent(); + return [3 /*break*/, 4]; + case 4: return [4 /*yield*/, this.list({ + partialName: nameOrId, + })]; + case 5: + projects = _b.sent(); + return [2 /*return*/, projects.Items.find(function (p) { return p.Name === nameOrId; })]; + } + }); + }); + }; + ProjectRepository.prototype.getChannels = function (project, gitRef, skip, take) { + if (skip === void 0) { skip = 0; } + if (take === void 0) { take = this.takeAll; } + if (gitRef && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { + return this.client.get(project.Links["Channels"], { skip: skip, take: take, gitRef: gitRef }); + } + return this.client.get(project.Links["Channels"], { skip: skip, take: take }); + }; + ProjectRepository.prototype.getDeployments = function (project) { + return this.client.get(this.client.getLink("Deployments"), { projects: project.Id }); + }; + ProjectRepository.prototype.getDeploymentSettings = function (project, gitRef) { + if (gitRef && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { + return this.client.get(project.Links["DeploymentSettings"], { gitRef: gitRef }); + } + return this.client.get(project.Links["DeploymentSettings"]); + }; + ProjectRepository.prototype.getReleases = function (project, args) { + return this.client.get(project.Links["Releases"], args); + }; + ProjectRepository.prototype.getReleaseByVersion = function (project, version) { + return this.client.get(project.Links["Releases"], { version: version }); + }; + ProjectRepository.prototype.list = function (args) { + return this.client.get(this.client.getLink("Projects"), __assign({}, args)); + }; + ProjectRepository.prototype.listByGroup = function (projectGroup) { + return this.client.get(projectGroup.Links["Projects"]); + }; + ProjectRepository.prototype.getTriggers = function (project, gitRef, skip, take, triggerActionType, triggerActionCategory, runbooks, partialName) { + return this.client.get(project.Links["Triggers"], { + skip: skip, + take: take, + gitRef: gitRef, + triggerActionType: triggerActionType, + triggerActionCategory: triggerActionCategory, + runbooks: runbooks, + partialName: partialName, + }); + }; + ProjectRepository.prototype.orderChannels = function (project) { + return this.client.post(project.Links["OrderChannels"]); + }; + ProjectRepository.prototype.getPulse = function (projects) { + var projectIds = projects + .map(function (p) { + return p.Id; + }) + .join(","); + return this.client.get(this.client.getLink("ProjectPulse"), { projectIds: projectIds }); + }; + ProjectRepository.prototype.getMetadata = function (project) { + return this.client.get(project.Links["Metadata"], {}); + }; + ProjectRepository.prototype.getRunbooks = function (project, args) { + return this.client.get(project.Links["Runbooks"], args); + }; + ProjectRepository.prototype.summaries = function () { + return this.client.get(this.client.getLink("ProjectsExperimentalSummaries")); + }; + ProjectRepository.prototype.getSummary = function (project, branch) { + return this.client.get(project.Links["Summary"], { gitRef: GetBranchDetails(branch) }); + }; + ProjectRepository.prototype.getBranch = function (project, branch) { + if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links) && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { + var branchName = ShouldUseDefaultBranch(branch) ? project.PersistenceSettings.DefaultBranch : branch; + return this.client.get(project.Links.Branches, { name: branchName }); + } + throw new Error("Cannot retrieve branches from non-VCS projects"); + }; + ProjectRepository.prototype.getBranches = function (project) { + if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links)) { + return this.client.get(project.Links.Branches); + } + throw new Error("Cannot retrieve branches from non-VCS projects"); + }; + ProjectRepository.prototype.searchBranches = function (project, partialBranchName) { + if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links)) { + return this.client.get(project.Links.Branches, { searchByName: partialBranchName }); + } + throw new Error("Cannot retrieve branches from non-VCS projects"); + }; + ProjectRepository.prototype.convertToVcs = function (project, payload) { + return this.client.post(project.Links.ConvertToVcs, payload); + }; + ProjectRepository.prototype.vcsCompatibilityReport = function (project) { + return this.client.get(project.Links["VersionControlCompatibilityReport"]); + }; + // TODO: @team-config-as-code - Our project needs a custom "Delete" link that does _not_ include the GitRef in order for us to + // successfully hit the /projects/{id} DEL endpoint. For EAP, we're out of time and just hacking it into the frontend client. + ProjectRepository.prototype.del = function (project) { + var _this = this; + if (project.IsVersionControlled) { + // Our "Self" link should currently include the GitRef. If so, and our last path does not look like our projectId, strip it. + var selfLinkParts = project.Links.Self.split("/"); + if (selfLinkParts[selfLinkParts.length - 1] !== project.Id) { + selfLinkParts.pop(); + } + var selfLink = selfLinkParts.join("/"); + return this.client.del(selfLink).then(function (d) { return _this.notifySubscribersToDataModifications(project); }); + } + else { + return this.client.del(project.Links.Self).then(function (d) { return _this.notifySubscribersToDataModifications(project); }); + } + }; + ProjectRepository.prototype.markAsStale = function (project) { + return this.client.post(project.Links["RepositoryModified"]); + }; + return ProjectRepository; +}(basicRepository_1.BasicRepository)); +function ShouldUseDefaultBranch(branch) { + return typeof branch === "object"; +} +function GetBranchDetails(branch) { + if (typeof branch === "string" || branch instanceof String) { + return branch; + } + else { + return branch === null || branch === void 0 ? void 0 : branch.Name; + } +} +exports["default"] = ProjectRepository; + + +/***/ }), + +/***/ 91795: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-non-null-assertion,jsdoc/require-param */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/consistent-type-assertions */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProjectScopedRepository = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var basicRepository_1 = __nccwpck_require__(30970); +var lodash_1 = __nccwpck_require__(90250); +var ProjectScopedRepository = /** @class */ (function (_super) { + __extends(ProjectScopedRepository, _super); + function ProjectScopedRepository(projectRepository, collectionLinkName, client) { + var _this = _super.call(this, collectionLinkName, client) || this; + _this.takeAll = 2147483647; + _this.projectRepository = projectRepository; + return _this; + } + ProjectScopedRepository.prototype.create = function (resource, args) { + var _this = this; + // Need to separate this out because it's either called immediately, or + var createInternal = function (projectResource, resource, args) { + // For now, we only want to use the project scoped endpoint for version controlled projects + // Database projects should remain as they were + if (projectResource.PersistenceSettings.Type == message_contracts_1.PersistenceSettingsType.VersionControlled) { + return _this.createForProject(projectResource, resource, args); + } + return _super.prototype.create.call(_this, resource, args); + }; + return this.projectRepository.get(resource.ProjectId).then(function (proj) { return createInternal(proj, resource, args); }); + }; + ProjectScopedRepository.prototype.createForProject = function (projectResource, resource, args) { + var _this = this; + var link = projectResource.Links[this.collectionLinkName]; + return this.client.create(link, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); + }; + ProjectScopedRepository.prototype.listFromProject = function (projectResource, args) { + var link = projectResource.Links[this.collectionLinkName]; + return this.client.get(link, args); + }; + ProjectScopedRepository.prototype.getFromProject = function (projectResource, id, args) { + if (projectResource.PersistenceSettings.Type == message_contracts_1.PersistenceSettingsType.VersionControlled) { + var allArgs = this.extend(args || {}, { id: id }); + var link = projectResource.Links[this.collectionLinkName]; + return this.client.get(link, allArgs); + } + return _super.prototype.get.call(this, id, args); + }; + ProjectScopedRepository.prototype.allFromProject = function (projectResource, args) { + if (args !== undefined && args.ids instanceof Array && args.ids.length === 0) { + return new Promise(function (res) { + res([]); + }); + } + // http.sys has a max query string of about 16k chars. Our typical max id length is 50 chars + // so if we are doing requests by id and have more than 300, split into multiple requests + var maxIds = 300; + if (args !== undefined && args.ids instanceof Array && args.ids.length > maxIds) { + return this.batchRequestsByIdForProject(projectResource, args, maxIds); + } + var allArgs = this.extend(args || {}, { take: this.takeAll }); + var link = projectResource.Links[this.collectionLinkName]; + return this.client.get(link, allArgs).then(function (res) { return res.Items; }); + }; + ProjectScopedRepository.prototype.saveToProject = function (projectResource, resource, args) { + if (isNewResource(resource)) { + return this.createForProject(projectResource, resource, args); + } + else { + //We need the cast here, since there is a bug in typescript where things don't narrow appropriately for generics https://github.com/microsoft/TypeScript/issues/44404 + //The usual workaround of inverting the checks doesn't seem to work here unfortunately so there is no way to avoid the cast until the bug is fixed. + return this.modify(resource, args); + } + function isTruthy(value) { + return !!value; + } + function isNewResource(resource) { + return !("Id" in resource && isTruthy(resource.Id) && isTruthy(resource.Links)); + } + }; + ProjectScopedRepository.prototype.batchRequestsByIdForProject = function (projectResource, args, batchSize) { + var _this = this; + var idArrays = (0, lodash_1.chunk)(args.ids, batchSize); + var promises = idArrays.map(function (ids) { + var newArgs = __assign(__assign({}, args), { ids: ids }); + var link = projectResource.Links[_this.collectionLinkName]; + return _this.client.get(link, newArgs); + }); + return Promise.all(promises).then(function (result) { return (0, lodash_1.flatten)(result); }); + }; + return ProjectScopedRepository; +}(basicRepository_1.BasicRepository)); +exports.ProjectScopedRepository = ProjectScopedRepository; + + +/***/ }), + +/***/ 57502: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProjectTriggerRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var ProjectTriggerRepository = /** @class */ (function (_super) { + __extends(ProjectTriggerRepository, _super); + function ProjectTriggerRepository(client) { + return _super.call(this, "ProjectTriggers", client) || this; + } + return ProjectTriggerRepository; +}(basicRepository_1.BasicRepository)); +exports.ProjectTriggerRepository = ProjectTriggerRepository; + + +/***/ }), + +/***/ 7358: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var ProxyRepository = /** @class */ (function (_super) { + __extends(ProxyRepository, _super); + function ProxyRepository(client) { + return _super.call(this, "Proxies", client) || this; + } + return ProxyRepository; +}(basicRepository_1.BasicRepository)); +exports.ProxyRepository = ProxyRepository; + + +/***/ }), + +/***/ 87252: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ReleasesRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var ReleasesRepository = /** @class */ (function (_super) { + __extends(ReleasesRepository, _super); + function ReleasesRepository(client) { + return _super.call(this, "Releases", client) || this; + } + ReleasesRepository.prototype.getDeployments = function (release, options) { + return this.client.get(release.Links["Deployments"], options); + }; + ReleasesRepository.prototype.getDeploymentTemplate = function (release) { + return this.client.get(release.Links["DeploymentTemplate"]); + }; + ReleasesRepository.prototype.getDeploymentPreview = function (promotionTarget) { + return this.client.get(promotionTarget.Links["Preview"], { includeDisabledSteps: true }); + }; + ReleasesRepository.prototype.progression = function (release) { + return this.client.get(release.Links["Progression"]); + }; + ReleasesRepository.prototype.snapshotVariables = function (release) { + return this.client.post(release.Links["SnapshotVariables"]); + }; + ReleasesRepository.prototype.deploymentPreviews = function (release, deploymentTemplates) { + return this.client.post(release.Links["DeploymentPreviews"], deploymentTemplates); + }; + ReleasesRepository.prototype.getChannel = function (release) { + return this.client.get(release.Links["Channel"]); + }; + ReleasesRepository.prototype.getLifecycle = function (release) { + return this.client.get(release.Links["Lifecycle"]); + }; + return ReleasesRepository; +}(basicRepository_1.BasicRepository)); +exports.ReleasesRepository = ReleasesRepository; + + +/***/ }), + +/***/ 11050: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RetentionDefaultConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var RetentionDefaultConfigurationRepository = /** @class */ (function (_super) { + __extends(RetentionDefaultConfigurationRepository, _super); + function RetentionDefaultConfigurationRepository(client) { + return _super.call(this, "RetentionDefaultConfiguration", client) || this; + } + return RetentionDefaultConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.RetentionDefaultConfigurationRepository = RetentionDefaultConfigurationRepository; + + +/***/ }), + +/***/ 82404: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RunbookProcessRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var RunbookProcessRepository = /** @class */ (function (_super) { + __extends(RunbookProcessRepository, _super); + function RunbookProcessRepository(client) { + return _super.call(this, "RunbookProcesses", client) || this; + } + RunbookProcessRepository.prototype.getRunbookSnapshotTemplate = function (runbookProcess, runbookSnapshotId) { + return this.client.get(runbookProcess.Links["RunbookSnapshotTemplate"], { runbookSnapshotId: runbookSnapshotId }); + }; + return RunbookProcessRepository; +}(basicRepository_1.BasicRepository)); +exports.RunbookProcessRepository = RunbookProcessRepository; + + +/***/ }), + +/***/ 18312: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RunbookRepository = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var semver_1 = __nccwpck_require__(11383); +var basicRepository_1 = __nccwpck_require__(30970); +var RunbookRepository = /** @class */ (function (_super) { + __extends(RunbookRepository, _super); + function RunbookRepository(client) { + var _this = _super.call(this, "Runbooks", client) || this; + _this.integrationTestVersion = new semver_1.SemVer("0.0.0-local"); + _this.versionAfterWhichRunbookRunParametersAreAvailable = new semver_1.SemVer("2020.3.1"); + return _this; + } + RunbookRepository.prototype.find = function (nameOrId, project) { + return __awaiter(this, void 0, void 0, function () { + var _a, runbooks; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (nameOrId.length === 0) + return [2 /*return*/]; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.get(nameOrId)]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: + _a = _b.sent(); + return [3 /*break*/, 4]; + case 4: return [4 /*yield*/, this.list({ + partialName: nameOrId, + projectIds: [project.Id] + })]; + case 5: + runbooks = _b.sent(); + return [2 /*return*/, runbooks.Items.find(function (r) { return r.Name === nameOrId; })]; + } + }); + }); + }; + RunbookRepository.prototype.getRunbookEnvironments = function (runbook) { + return this.client.get(runbook.Links["RunbookEnvironments"]); + }; + RunbookRepository.prototype.getRunbookRunPreview = function (promotionTarget) { + return this.client.get(promotionTarget.Links["RunbookRunPreview"], { includeDisabledSteps: true }); + }; + RunbookRepository.prototype.getRunbookRunTemplate = function (runbook) { + return this.client.get(runbook.Links["RunbookRunTemplate"]); + }; + RunbookRepository.prototype.getRunbookSnapshots = function (runbook, args) { + return this.client.get(runbook.Links["RunbookSnapshots"], args); + }; + RunbookRepository.prototype.getRunbookSnapshotTemplate = function (runbook) { + return this.client.get(runbook.Links["RunbookSnapshotTemplate"]); + }; + RunbookRepository.prototype.run = function (runbook, runbookRun) { + return __awaiter(this, void 0, void 0, function () { + var supportsRunbookRunParameters, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + supportsRunbookRunParameters = this.serverSupportsRunbookRunParameters(this.client.getServerInformation().version); + if (!supportsRunbookRunParameters) return [3 /*break*/, 2]; + return [4 /*yield*/, this.runWithParameters(runbook, message_contracts_1.RunbookRunParameters.MapFrom(runbookRun))]; + case 1: + _a = (_b.sent())[0]; + return [3 /*break*/, 4]; + case 2: return [4 /*yield*/, this.client.post(runbook.Links["CreateRunbookRun"], runbookRun)]; + case 3: + _a = _b.sent(); + _b.label = 4; + case 4: return [2 /*return*/, _a]; + } + }); + }); + }; + RunbookRepository.prototype.runWithParameters = function (runbook, runbookRunParameters) { + return __awaiter(this, void 0, void 0, function () { + var serverVersion, serverSupportsRunbookRunParameters; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + serverVersion = this.client.getServerInformation().version; + serverSupportsRunbookRunParameters = this.serverSupportsRunbookRunParameters(serverVersion); + if (!serverSupportsRunbookRunParameters) + throw new Error("This Octopus Deploy server is an older version ".concat(serverVersion, " that does not yet support RunbookRunParameters. Please update your Octopus Deploy server to 2020.3.* or newer to access this feature.")); + return [4 /*yield*/, this.client.post(runbook.Links["CreateRunbookRun"], runbookRunParameters)]; + case 1: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; + RunbookRepository.prototype.serverSupportsRunbookRunParameters = function (version) { + var serverVersion = new semver_1.SemVer(version); + // note: ensure the server version is >= *any* 2020.3.1 + return serverVersion >= this.versionAfterWhichRunbookRunParametersAreAvailable || serverVersion == this.integrationTestVersion; + }; + return RunbookRepository; +}(basicRepository_1.BasicRepository)); +exports.RunbookRepository = RunbookRepository; + + +/***/ }), + +/***/ 30242: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RunbookRunRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var RunbookRunRepository = /** @class */ (function (_super) { + __extends(RunbookRunRepository, _super); + function RunbookRunRepository(client) { + return _super.call(this, "RunbookRuns", client) || this; + } + return RunbookRunRepository; +}(basicRepository_1.BasicRepository)); +exports.RunbookRunRepository = RunbookRunRepository; + + +/***/ }), + +/***/ 73544: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RunbookSnapshotRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var RunbookSnapshotRepository = /** @class */ (function (_super) { + __extends(RunbookSnapshotRepository, _super); + function RunbookSnapshotRepository(client) { + return _super.call(this, "RunbookSnapshots", client) || this; + } + RunbookSnapshotRepository.prototype.getRunbookRunPreviewForPromotionTarget = function (promotionTarget) { + return this.client.get(promotionTarget.Links["RunbookRunPreview"], { includeDisabledSteps: true }); + }; + RunbookSnapshotRepository.prototype.getRunbookRuns = function (runbookSnapshot, options) { + return this.client.get(runbookSnapshot.Links["RunbookRuns"], options); + }; + RunbookSnapshotRepository.prototype.getRunbookRunTemplate = function (runbookSnapshot) { + return this.client.get(runbookSnapshot.Links["RunbookRunTemplate"]); + }; + RunbookSnapshotRepository.prototype.snapshotVariables = function (runbookSnapshot) { + return this.client.post(runbookSnapshot.Links["SnapshotVariables"]); + }; + return RunbookSnapshotRepository; +}(basicRepository_1.BasicRepository)); +exports.RunbookSnapshotRepository = RunbookSnapshotRepository; + + +/***/ }), + +/***/ 63767: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SchedulerRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var SchedulerRepository = /** @class */ (function (_super) { + __extends(SchedulerRepository, _super); + function SchedulerRepository(client) { + return _super.call(this, "Scheduler", client) || this; + } + SchedulerRepository.prototype.getDetails = function (name, options) { + var args = __assign(__assign({}, options), { name: name }); + return this.client.get(this.client.getLink("Scheduler"), args); + }; + return SchedulerRepository; +}(basicRepository_1.BasicRepository)); +exports.SchedulerRepository = SchedulerRepository; + + +/***/ }), + +/***/ 18774: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ScopedUserRoleRepository = void 0; +var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); +var ScopedUserRoleRepository = /** @class */ (function (_super) { + __extends(ScopedUserRoleRepository, _super); + function ScopedUserRoleRepository(client) { + return _super.call(this, "ScopedUserRoles", client) || this; + } + return ScopedUserRoleRepository; +}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); +exports.ScopedUserRoleRepository = ScopedUserRoleRepository; + + +/***/ }), + +/***/ 96489: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ServerConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var ServerConfigurationRepository = /** @class */ (function (_super) { + __extends(ServerConfigurationRepository, _super); + function ServerConfigurationRepository(client) { + return _super.call(this, "ServerConfiguration", client) || this; + } + ServerConfigurationRepository.prototype.settings = function () { + return this.client.get(this.client.getLink("ServerConfigurationSettings")); + }; + return ServerConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.ServerConfigurationRepository = ServerConfigurationRepository; + + +/***/ }), + +/***/ 84463: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ServerStatusRepository = void 0; +var ServerStatusRepository = /** @class */ (function () { + function ServerStatusRepository(client) { + this.client = client; + } + ServerStatusRepository.prototype.getServerStatus = function () { + return this.client.get(this.client.getLink("ServerStatus")); + }; + ServerStatusRepository.prototype.getLogs = function (status, args) { + return this.client.get(status.Links["RecentLogs"], args); + }; + ServerStatusRepository.prototype.getHealth = function (status) { + return this.client.get(status.Links["Health"]); + }; + ServerStatusRepository.prototype.getSystemInfo = function (status) { + return this.client.get(status.Links["SystemInfo"]); + }; + ServerStatusRepository.prototype.gcCollect = function (status) { + return this.client.post(status.Links["GCCollect"], status); + }; + ServerStatusRepository.prototype.getDocumentCounts = function (status) { + return this.client.get(status.Links["DocumentCounts"]); + }; + ServerStatusRepository.prototype.getExtensionStats = function () { + return this.client.get(this.client.getLink("ExtensionStats")); + }; + ServerStatusRepository.prototype.getTimezones = function () { + return this.client.get(this.client.getLink("Timezones")); + }; + return ServerStatusRepository; +}()); +exports.ServerStatusRepository = ServerStatusRepository; + + +/***/ }), + +/***/ 50924: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +var basicRepository_1 = __nccwpck_require__(30970); +var SettingsRepository = /** @class */ (function (_super) { + __extends(SettingsRepository, _super); + function SettingsRepository(client) { + return _super.call(this, "Configuration", client) || this; + } + SettingsRepository.prototype.getById = function (id) { + return this.client.get(this.client.getLink("Configuration"), { id: id }); + }; + SettingsRepository.prototype.getValues = function (resource) { + return this.client.get(resource.Links["Values"]); + }; + SettingsRepository.prototype.getMetadata = function (resource) { + return this.client.get(resource.Links["Metadata"]); + }; + SettingsRepository.prototype.saveValues = function (metadataResource, resource) { + return this.client.put(metadataResource.Links["Values"], resource); + }; + return SettingsRepository; +}(basicRepository_1.BasicRepository)); +exports["default"] = SettingsRepository; + + +/***/ }), + +/***/ 7025: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SmtpConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var SmtpConfigurationRepository = /** @class */ (function (_super) { + __extends(SmtpConfigurationRepository, _super); + function SmtpConfigurationRepository(client) { + return _super.call(this, "SmtpConfiguration", client) || this; + } + SmtpConfigurationRepository.prototype.IsConfigured = function () { + return this.client.get(this.client.getLink("SmtpIsConfigured")); + }; + return SmtpConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.SmtpConfigurationRepository = SmtpConfigurationRepository; + + +/***/ }), + +/***/ 56836: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SpaceRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var SpaceRepository = /** @class */ (function (_super) { + __extends(SpaceRepository, _super); + function SpaceRepository(client) { + return _super.call(this, "Spaces", client) || this; + } + SpaceRepository.prototype.search = function (keyword) { + return this.client.get(this.client.getLink("SpaceSearch"), { id: this.client.spaceId, keyword: keyword }); + }; + return SpaceRepository; +}(basicRepository_1.BasicRepository)); +exports.SpaceRepository = SpaceRepository; + + +/***/ }), + +/***/ 94178: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +var basicRepository_1 = __nccwpck_require__(30970); +var SubscriptionRepository = /** @class */ (function (_super) { + __extends(SubscriptionRepository, _super); + function SubscriptionRepository(client) { + return _super.call(this, "Subscriptions", client) || this; + } + return SubscriptionRepository; +}(basicRepository_1.BasicRepository)); +exports["default"] = SubscriptionRepository; + + +/***/ }), + +/***/ 50450: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +var basicRepository_1 = __nccwpck_require__(30970); +var TagSetRepository = /** @class */ (function (_super) { + __extends(TagSetRepository, _super); + function TagSetRepository(client) { + return _super.call(this, "TagSets", client) || this; + } + TagSetRepository.prototype.sort = function (ids) { + return this.client.put(this.client.getLink("TagSetSortOrder"), ids); + }; + return TagSetRepository; +}(basicRepository_1.BasicRepository)); +exports["default"] = TagSetRepository; + + +/***/ }), + +/***/ 53573: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TaskRepository = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var lodash_1 = __nccwpck_require__(90250); +var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); +var TaskRepository = /** @class */ (function (_super) { + __extends(TaskRepository, _super); + function TaskRepository(client) { + return _super.call(this, "Tasks", client) || this; + } + TaskRepository.prototype.createPerformIntegrityCheckTask = function () { + return this.createSystemTask(message_contracts_1.TaskName.SystemIntegrityCheck, "Check System Integrity", {}); + }; + TaskRepository.prototype.createSynchronizeCommunityStepTemplatesTask = function () { + return this.createSystemTask(message_contracts_1.TaskName.SyncCommunityActionTemplates, "Synchronize Community Step Templates", {}); + }; + TaskRepository.prototype.createConfigureLetsEncryptTask = function (letsEncryptArguments) { + return this.createSystemTask(message_contracts_1.TaskName.ConfigureLetsEncrypt, "Configure Let's Encrypt SSL Certificate", letsEncryptArguments); + }; + TaskRepository.prototype.createRenewLetsEncryptTask = function (letsEncryptArguments) { + return this.createSystemTask(message_contracts_1.TaskName.ConfigureLetsEncrypt, "Renew Let's Encrypt SSL Certificate", letsEncryptArguments); + }; + TaskRepository.prototype.createSendTestEmailTask = function (emailAddress) { + return this.createSystemTask(message_contracts_1.TaskName.TestEmail, "Send test email", { EmailAddress: emailAddress }); + }; + TaskRepository.prototype.createUpgradeTentaclesTask = function () { + return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacles", {}); + }; + TaskRepository.prototype.createUpgradeTentaclesTaskForEnvironment = function (environment, machineIds) { + var description = environment ? "Upgrade Tentacles in ".concat(environment.Name) : "Upgrade Tentacles"; + var upgradeTaskArguments = __assign({ RestrictedTo: message_contracts_1.TaskRestrictedTo.DeploymentTargets, MachineIds: machineIds }, (environment ? { EnvironmentId: environment.Id } : {})); + return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, description, upgradeTaskArguments); + }; + TaskRepository.prototype.createUpgradeTentacleOnMachineTask = function (machine) { + if (machine.Id !== null && machine.Id !== undefined) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacle on ".concat(machine.Name), { MachineIds: [machine.Id] }); + } + }; + TaskRepository.prototype.createUpgradeTentacleOnWorkerPoolTask = function (workerPool, machineIds) { + var description = workerPool ? "Upgrade Tentacles in ".concat(workerPool.Name) : "Upgrade Tentacles"; + var upgradeTaskArguments = __assign({ RestrictedTo: message_contracts_1.TaskRestrictedTo.Workers, MachineIds: machineIds }, (workerPool ? { WorkerPoolId: workerPool.Id } : {})); + return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, description, upgradeTaskArguments); + }; + TaskRepository.prototype.createUpgradeTentaclesTaskRestrictedTo = function (restrictedTo, MachineIds) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacles", { RestrictedTo: restrictedTo, MachineIds: MachineIds }); + }; + TaskRepository.prototype.createPerformHealthCheckTaskForEnvironment = function (environment, machineIds) { + var description = environment ? "Check deployment target health in ".concat(environment.Name) : "Check deployment target health"; + var healthCheckArguments = __assign({ Timeout: "00:05:00", OnlyTestConnection: false, RestrictedTo: message_contracts_1.TaskRestrictedTo.DeploymentTargets, MachineIds: machineIds }, (environment ? { EnvironmentId: environment.Id } : {})); + return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, healthCheckArguments); + }; + TaskRepository.prototype.createPerformHealthCheckTaskForWorkerPool = function (workerPool, machineIds) { + var description = workerPool ? "Check worker health in ".concat(workerPool.Name) : "Check worker health"; + var healthCheckArguments = __assign({ Timeout: "00:05:00", OnlyTestConnection: false, RestrictedTo: message_contracts_1.TaskRestrictedTo.Workers, MachineIds: machineIds }, (workerPool ? { WorkerPoolId: workerPool.Id } : {})); + return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, healthCheckArguments); + }; + TaskRepository.prototype.createHealthCheckTaskForMachine = function (machine) { + if (machine.Id !== null && machine.Id !== undefined) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, "Check ".concat(machine.Name, " health"), { + Timeout: "00:05:00", + MachineIds: [machine.Id], + OnlyTestConnection: false, + }); + } + }; + TaskRepository.prototype.createHealthCheckTaskRestrictedTo = function (restrictedTo, machineIds) { + var description = restrictedTo === message_contracts_1.TaskRestrictedTo.Workers ? "Check worker health" : "Check deployment target health"; + return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, { + Timeout: "00:05:00", + OnlyTestConnection: false, + RestrictedTo: restrictedTo, + MachineIds: machineIds, + }); + }; + TaskRepository.prototype.createUpdateCalamariOnTargetsTask = function (deploymentTargetIds) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Update Calamari on Deployment Targets", { MachineIds: deploymentTargetIds }); + }; + TaskRepository.prototype.createUpdateCalamariOnWorkersTask = function (workerIds) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Upgrade Calamari on Workers", { MachineIds: workerIds }); + }; + TaskRepository.prototype.createUpdateCalamariOnTargetTask = function (machine) { + if (machine.Id !== null && machine.Id !== undefined) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Update Calamari on ".concat(machine.Name), { MachineIds: [machine.Id] }); + } + }; + TaskRepository.prototype.createSynchronizeBuiltInPackageRepositoryTask = function () { + return this.createSpaceScopedTask(message_contracts_1.TaskName.SynchronizeBuiltInPackageRepositoryIndex, "Re-index built-in package repository", {}); + }; + TaskRepository.prototype.createTestAzureAccountTask = function (azureAccountId) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Azure account", { AccountId: azureAccountId }); + }; + TaskRepository.prototype.createTestAwsAccountTask = function (awsAccountId) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Amazon Web Services account", { AccountId: awsAccountId }); + }; + TaskRepository.prototype.createTestGoogleCloudAccountTask = function (googleCloudAccountId) { + return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Google Cloud account", { AccountId: googleCloudAccountId }); + }; + TaskRepository.prototype.createRunActionTemplateTask = function (targets, properties, template) { + var runActionTemplateArguments = __assign(__assign({}, targets), { Properties: properties, ActionTemplateId: template.Id }); + return this.createSpaceScopedTask(message_contracts_1.TaskName.AdHocScript, "Run step template: " + template.Name, runActionTemplateArguments); + }; + TaskRepository.prototype.createScriptConsoleTask = function (targets, syntax, scriptBody) { + var scriptConsoleArguments = __assign(__assign({}, targets), { Syntax: syntax, ScriptBody: scriptBody }); + return this.createSpaceScopedTask(message_contracts_1.TaskName.AdHocScript, "Script run from management console", scriptConsoleArguments); + }; + TaskRepository.prototype.create = function (resource, args) { + throw new Error("Can't create generic tasks. Instead, concrete task factory methods on the TaskRepository should be used to create tasks"); + }; + TaskRepository.prototype.details = function (task, args) { + return this.client.get(task.Links["Details"], args); + }; + TaskRepository.prototype.getQueuedBehind = function (task, args) { + var combinedParameters = this.extend(this.spacePartitionParameters(), args); + return this.client.get(task.Links["QueuedBehind"], combinedParameters); + }; + TaskRepository.prototype.getRaw = function (task) { + return this.client.getRaw(task.Links["Raw"]); + }; + TaskRepository.prototype.taskTypes = function () { + return this.client.get(this.client.getLink("TaskTypes"), {}); + }; + TaskRepository.prototype.filter = function (args) { + var combinedParameters = this.extend(this.spacePartitionParameters(), args); + return this.client.get(this.client.getLink("Tasks"), combinedParameters); + }; + TaskRepository.prototype.rerun = function (task) { + return this.client.post(task.Links["Rerun"]); + }; + TaskRepository.prototype.cancel = function (task) { + return this.client.post(task.Links["Cancel"]); + }; + TaskRepository.prototype.changeState = function (task, state, reason) { + return this.client.post(task.Links["State"], { state: state, reason: reason }); + }; + TaskRepository.prototype.list = function (args) { + return _super.prototype.list.call(this, args); + }; + TaskRepository.prototype.byIds = function (ids) { + var _this = this; + var batchSize = 300; + var idArrays = (0, lodash_1.chunk)(ids, batchSize); + var promises = idArrays.map(function (i) { + return _this.list({ ids: i, take: batchSize }); + }); + return Promise.all(promises).then(function (result) { return (0, lodash_1.flatMap)(result, function (c) { return c.Items; }); }); + }; + TaskRepository.prototype.createSystemTask = function (name, description, taskArguments) { + return _super.prototype.create.call(this, { + Name: name, + Description: description, + Arguments: taskArguments, + SpaceId: null, + }); + }; + TaskRepository.prototype.createSpaceScopedTask = function (name, description, taskArguments) { + if (!this.client.spaceId) { + throw new Error("Tried to create a space scoped task without being in the context of a space"); + } + return _super.prototype.create.call(this, { + Name: name, + Description: description, + Arguments: taskArguments, + SpaceId: this.client.spaceId, + }); + }; + return TaskRepository; +}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); +exports.TaskRepository = TaskRepository; + - if (!newMethods[scope]) { - newMethods[scope] = {}; - } +/***/ }), - const scopeMethods = newMethods[scope]; +/***/ 30986: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - if (decorations) { - scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations); - continue; - } +"use strict"; - scopeMethods[methodName] = octokit.request.defaults(endpointDefaults); +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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); +var TeamMembershipRepository = /** @class */ (function () { + function TeamMembershipRepository(client) { + this.client = client; } - } + TeamMembershipRepository.prototype.getForUser = function (user, includeSystem) { + return this.client.get(this.client.getLink("TeamMembership"), __assign({ userId: user.Id }, (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem))); + }; + TeamMembershipRepository.prototype.previewTeam = function (team) { + return this.client.post(this.client.getLink("TeamMembershipPreviewTeam"), team); + }; + return TeamMembershipRepository; +}()); +exports["default"] = TeamMembershipRepository; - return newMethods; -} -function decorate(octokit, scope, methodName, defaults, decorations) { - const requestWithDefaults = octokit.request.defaults(defaults); - /* istanbul ignore next */ +/***/ }), - 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` +/***/ 66168: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - if (decorations.mapToData) { - options = Object.assign({}, options, { - data: options[decorations.mapToData], - [decorations.mapToData]: undefined - }); - return requestWithDefaults(options); - } +"use strict"; - if (decorations.renamed) { - const [newScope, newMethodName] = decorations.renamed; - octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`); +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TeamRepository = void 0; +var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); +var TeamRepository = /** @class */ (function (_super) { + __extends(TeamRepository, _super); + function TeamRepository(client) { + return _super.call(this, "Teams", client) || this; } + TeamRepository.prototype.listScopedUserRoles = function (team) { + return this.client.get(team.Links["ScopedUserRoles"], this.spacePartitionParameters()); + }; + TeamRepository.prototype.list = function (args) { + return _super.prototype.list.call(this, args); + }; + return TeamRepository; +}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); +exports.TeamRepository = TeamRepository; - if (decorations.deprecated) { - octokit.log.warn(decorations.deprecated); - } - if (decorations.renamedParameters) { - // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 - const options = requestWithDefaults.endpoint.merge(...args); +/***/ }), - 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`); +/***/ 54198: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - if (!(alias in options)) { - options[alias] = options[name]; - } +"use strict"; - delete options[name]; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +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 requestWithDefaults(options); - } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488 - - - return requestWithDefaults(...args); - } - - return Object.assign(withDecorations, requestWithDefaults); -} - -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; - -exports.legacyRestEndpointMethods = legacyRestEndpointMethods; -exports.restEndpointMethods = restEndpointMethods; -//# sourceMappingURL=index.js.map + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +var basicRepository_1 = __nccwpck_require__(30970); +var TenantRepository = /** @class */ (function (_super) { + __extends(TenantRepository, _super); + function TenantRepository(client) { + return _super.call(this, "Tenants", client) || this; + } + TenantRepository.prototype.find = function (namesOrIds) { + return __awaiter(this, void 0, void 0, function () { + var environments, matchingEnvironments, _a, _loop_1, this_1, _i, namesOrIds_1, name_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + if (namesOrIds.length === 0) + return [2 /*return*/, []]; + environments = []; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, this.list({ + ids: namesOrIds, + })]; + case 2: + matchingEnvironments = _b.sent(); + environments.push.apply(environments, matchingEnvironments.Items); + return [3 /*break*/, 4]; + case 3: + _a = _b.sent(); + return [3 /*break*/, 4]; + case 4: + _loop_1 = function (name_1) { + var matchingEnvironments; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [4 /*yield*/, this_1.list({ + name: name_1, + })]; + case 1: + matchingEnvironments = _c.sent(); + environments.push.apply(environments, matchingEnvironments.Items.filter(function (e) { return e.Name.localeCompare(name_1, undefined, { sensitivity: 'base' }) === 0; })); + return [2 /*return*/]; + } + }); + }; + this_1 = this; + _i = 0, namesOrIds_1 = namesOrIds; + _b.label = 5; + case 5: + if (!(_i < namesOrIds_1.length)) return [3 /*break*/, 8]; + name_1 = namesOrIds_1[_i]; + return [5 /*yield**/, _loop_1(name_1)]; + case 6: + _b.sent(); + _b.label = 7; + case 7: + _i++; + return [3 /*break*/, 5]; + case 8: return [2 /*return*/, environments]; + } + }); + }); + }; + TenantRepository.prototype.status = function () { + return this.client.get(this.client.getLink("TenantsStatus")); + }; + TenantRepository.prototype.tagTest = function (tenantIds, tags) { + return this.client.get(this.client.getLink("TenantTagTest"), { tenantIds: tenantIds, tags: tags }); + }; + TenantRepository.prototype.getVariables = function (tenant) { + return this.client.get(tenant.Links["Variables"]); + }; + TenantRepository.prototype.setVariables = function (tenant, variables) { + return this.client.put(tenant.Links["Variables"], variables); + }; + TenantRepository.prototype.missingVariables = function (filterOptions, includeDetails) { + if (filterOptions === void 0) { filterOptions = {}; } + if (includeDetails === void 0) { includeDetails = false; } + var payload = { + environmentId: filterOptions.environmentId, + includeDetails: !!includeDetails, + projectId: filterOptions.projectId, + tenantId: filterOptions.tenantId, + }; + return this.client.get(this.client.getLink("TenantsMissingVariables"), payload); + }; + TenantRepository.prototype.list = function (args) { + return this.client.get(this.client.getLink("Tenants"), __assign({}, args)); + }; + return TenantRepository; +}(basicRepository_1.BasicRepository)); +exports["default"] = TenantRepository; /***/ }), -/***/ 10537: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 19652: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); +var basicRepository_1 = __nccwpck_require__(30970); +var TenantVariableRepository = /** @class */ (function (_super) { + __extends(TenantVariableRepository, _super); + function TenantVariableRepository(client) { + return _super.call(this, "TenantVariables", client) || this; + } + return TenantVariableRepository; +}(basicRepository_1.BasicRepository)); +exports["default"] = TenantVariableRepository; -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 - */ - -class RequestError extends Error { - constructor(message, statusCode, options) { - super(message); // Maintains proper stack trace (only available on V8) - /* istanbul ignore next */ +/***/ }), - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } +/***/ 99284: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - this.name = "HttpError"; - this.status = statusCode; - let headers; +"use strict"; - if ("headers" in options && typeof options.headers !== "undefined") { - headers = options.headers; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UpgradeConfigurationRepository = void 0; +var configurationRepository_1 = __nccwpck_require__(13497); +var UpgradeConfigurationRepository = /** @class */ (function (_super) { + __extends(UpgradeConfigurationRepository, _super); + function UpgradeConfigurationRepository(client) { + return _super.call(this, "UpgradeConfiguration", client) || this; } + return UpgradeConfigurationRepository; +}(configurationRepository_1.ConfigurationRepository)); +exports.UpgradeConfigurationRepository = UpgradeConfigurationRepository; - if ("response" in options) { - this.response = options.response; - headers = options.response.headers; - } // redact request credentials without mutating original request options +/***/ }), - const requestCopy = Object.assign({}, options.request); +/***/ 67597: +/***/ ((__unused_webpack_module, exports) => { - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]") - }); - } +"use strict"; - 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 +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UserIdentityMetadataRepository = void 0; +var UserIdentityMetadataRepository = /** @class */ (function () { + function UserIdentityMetadataRepository(client) { + this.client = client; + } + UserIdentityMetadataRepository.prototype.all = function () { + return this.client.get(this.client.getLink("UserIdentityMetadata")); + }; + UserIdentityMetadataRepository.prototype.authenticationConfiguration = function (userId) { + return this.client.get(this.client.getLink("UserAuthentication"), { userId: userId }); + }; + return UserIdentityMetadataRepository; +}()); +exports.UserIdentityMetadataRepository = UserIdentityMetadataRepository; - Object.defineProperty(this, "code", { - get() { - logOnceCode(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")); - return statusCode; - } - }); - Object.defineProperty(this, "headers", { - get() { - logOnceHeaders(new deprecation.Deprecation("[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.")); - return headers || {}; - } +/***/ }), - }); - } +/***/ 41025: +/***/ ((__unused_webpack_module, exports) => { -} +"use strict"; -exports.RequestError = RequestError; -//# sourceMappingURL=index.js.map +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UserOnBoardingRepository = void 0; +var UserOnBoardingRepository = /** @class */ (function () { + function UserOnBoardingRepository(client) { + this.client = client; + } + UserOnBoardingRepository.prototype.get = function () { + return this.client.get(this.client.getLink("UserOnboarding")); + }; + return UserOnBoardingRepository; +}()); +exports.UserOnBoardingRepository = UserOnBoardingRepository; /***/ }), -/***/ 36234: +/***/ 27747: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.UserPermissionRepository = void 0; +var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); +var UserPermissionRepository = /** @class */ (function () { + function UserPermissionRepository(client) { + this.client = client; + } + UserPermissionRepository.prototype.getAllPermissions = function (user, includeSystem) { + return this.client.get(user.Links["Permissions"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)("all", includeSystem)); + }; + UserPermissionRepository.prototype.getPermissionsForCurrentSpaceContext = function (user, includeSystem) { + return this.client.get(user.Links["Permissions"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem)); + }; + UserPermissionRepository.prototype.getPermissionsConfigurationForAllParitions = function (user, includeSystem) { + return this.client.get(user.Links["PermissionsConfiguration"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)("all", includeSystem)); + }; + UserPermissionRepository.prototype.getPermissionsConfigurationForCurrentSpaceContext = function (user, includeSystem) { + return this.client.get(user.Links["PermissionsConfiguration"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem)); + }; + return UserPermissionRepository; +}()); +exports.UserPermissionRepository = UserPermissionRepository; -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -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.3"; +/***/ 10895: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -function getBufferResponse(response) { - return response.arrayBuffer(); -} +"use strict"; -function fetchWrapper(requestOptions) { - const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +var basicRepository_1 = __nccwpck_require__(30970); +var UserRepository = /** @class */ (function (_super) { + __extends(UserRepository, _super); + function UserRepository(client) { + return _super.call(this, "Users", client) || this; + } + UserRepository.prototype.createApiKey = function (user, purpose, expires) { + return this.client.post(user.Links["ApiKeys"], { Purpose: purpose, Expires: expires }); + }; + UserRepository.prototype.getCurrent = function () { + return this.client.get(this.client.getLink("CurrentUser")); + }; + UserRepository.prototype.getSpaces = function (user) { + return this.client.get(user.Links["Spaces"]); + }; + UserRepository.prototype.getTriggers = function (user) { + return this.client.get(user.Links["Triggers"]); + }; + UserRepository.prototype.listApiKeys = function (user) { + return this.client.get(user.Links["ApiKeys"], { take: this.takeAll }); + }; + UserRepository.prototype.register = function (registerCommand) { + return this.client.post(this.client.getLink("Register"), registerCommand); + }; + UserRepository.prototype.revokeApiKey = function (apiKey) { + return this.client.del(apiKey.Links["Self"]); + }; + UserRepository.prototype.signIn = function (loginCommand) { + var _this = this; + return this.client.post(this.client.getLink("SignIn"), loginCommand).then(function (authenticatedUser) { + var antiforgeryToken = _this.client.getAntiforgeryToken(); + if (!antiforgeryToken) { + throw new Error("The required anti-forgery cookie is missing. Perhaps your browser " + "or another network device is blocking cookies? " + "See http://g.octopushq.com/CSRF for more details and troubleshooting."); + } + return authenticatedUser; + }); + }; + UserRepository.prototype.signOut = function () { + return this.client.post(this.client.getLink("SignOut"), {}); + }; + return UserRepository; +}(basicRepository_1.BasicRepository)); +exports["default"] = UserRepository; - if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); - } - 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]; - } +/***/ 74126: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - 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}` : ""}`); +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +var basicRepository_1 = __nccwpck_require__(30970); +var UserRoleRepository = /** @class */ (function (_super) { + __extends(UserRoleRepository, _super); + function UserRoleRepository(client) { + return _super.call(this, "UserRoles", client) || this; } + return UserRoleRepository; +}(basicRepository_1.BasicRepository)); +exports["default"] = UserRoleRepository; - if (status === 204 || status === 205) { - return; - } // GitHub API returns 200 for HEAD requests +/***/ }), - if (requestOptions.method === "HEAD") { - if (status < 400) { - return; - } +/***/ 72887: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - throw new requestError.RequestError(response.statusText, status, { - response: { - url, - status, - headers, - data: undefined - }, - request: requestOptions - }); - } +"use strict"; - if (status === 304) { - throw new requestError.RequestError("Not modified", status, { - response: { - url, - status, - headers, - data: await getResponseData(response) - }, - request: requestOptions - }); +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +var basicRepository_1 = __nccwpck_require__(30970); +var VariableRepository = /** @class */ (function (_super) { + __extends(VariableRepository, _super); + function VariableRepository(client) { + return _super.call(this, "Variables", client) || this; } + // FIXME: cac-runbooks, need to be able to load variables for VCS runbooks too + VariableRepository.prototype.getNamesForDeploymentProcess = function (projectId, projectEnvironmentsFilter) { + return this.client.get(this.client.getLink("VariableNames"), { + project: projectId, + projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, + }); + }; + VariableRepository.prototype.getNamesForRunbookProcess = function (projectId, runbookId, projectEnvironmentsFilter) { + return this.client.get(this.client.getLink("VariableNames"), { + project: projectId, + runbook: runbookId, + projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, + }); + }; + VariableRepository.prototype.getSpecialVariableNames = function () { + return this.client.get(this.client.getLink("VariableNames"), {}); + }; + // FIXME: cac-runbooks, need to be able to load variables for VCS runbooks too + VariableRepository.prototype.preview = function (projectId, runbookId, actionId, environmentId, machineId, channelId, tenantId) { + return this.client.get(this.client.getLink("VariablePreview"), { + project: projectId, + runbook: runbookId, + environment: environmentId, + channel: channelId, + tenant: tenantId, + action: actionId, + machine: machineId, + }); + }; + return VariableRepository; +}(basicRepository_1.BasicRepository)); +exports["default"] = VariableRepository; - 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 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 - }); - }); -} +/***/ }), -async function getResponseData(response) { - const contentType = response.headers.get("content-type"); +/***/ 50210: +/***/ ((__unused_webpack_module, exports) => { - if (/application\/json/.test(contentType)) { - return response.json(); - } +"use strict"; - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.VcsRunbookRepository = void 0; +var VcsRunbookRepository = /** @class */ (function () { + function VcsRunbookRepository(client, project, branch) { + this.client = client; + this.project = project; + this.branch = branch; + this.client = client; + } + VcsRunbookRepository.prototype.getBranch = function () { + if (!this.branch) + throw new Error("Can't use VCS Runbook Repository unless there is a branch available in the VCS Project"); + return this.branch; + }; + // TODO: @team-config-as-code create and pass in a command instead of the reasource + VcsRunbookRepository.prototype.create = function (newVcsRunbook) { + return this.client.create(this.getBranch().Links.Runbook, newVcsRunbook, {}); + }; + VcsRunbookRepository.prototype.del = function (vcsRunbook) { + return this.client.del(vcsRunbook.Links.Self, vcsRunbook); + }; + VcsRunbookRepository.prototype.get = function (id) { + return this.client.get(this.getBranch().Links.Runbook, { id: id }); + }; + VcsRunbookRepository.prototype.list = function (args) { + return this.client.get(this.getBranch().Links.Runbook, args); + }; + VcsRunbookRepository.prototype.modify = function (vcsRunbook) { + return this.client.update(vcsRunbook.Links.Self, vcsRunbook); + }; + return VcsRunbookRepository; +}()); +exports.VcsRunbookRepository = VcsRunbookRepository; - return getBufferResponse(response); -} -function toErrorMessage(data) { - if (typeof data === "string") return data; // istanbul ignore else - just in case +/***/ }), - if ("message" in data) { - if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; - } +/***/ 65737: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - return data.message; - } // istanbul ignore next - just in case +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WorkerPoolsRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var WorkerPoolsRepository = /** @class */ (function (_super) { + __extends(WorkerPoolsRepository, _super); + function WorkerPoolsRepository(client) { + return _super.call(this, "WorkerPools", client) || this; + } + WorkerPoolsRepository.prototype.machines = function (workerPool, args) { + return this.client.get(workerPool.Links["Workers"], args); + }; + WorkerPoolsRepository.prototype.summary = function (args) { + return this.client.get(this.client.getLink("WorkerPoolsSummary"), args); + }; + WorkerPoolsRepository.prototype.sort = function (order) { + return this.client.put(this.client.getLink("WorkerPoolsSortOrder"), order); + }; + WorkerPoolsRepository.prototype.getSupportedPoolTypes = function () { + return this.client.get(this.client.getLink("WorkerPoolsSupportedTypes")); + }; + WorkerPoolsRepository.prototype.getDynamicWorkerTypes = function () { + return __awaiter(this, void 0, void 0, function () { + var result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.client.get(this.client.getLink("WorkerPoolsDynamicWorkerTypes"))]; + case 1: + result = _a.sent(); + return [2 /*return*/, result.WorkerTypes]; + } + }); + }); + }; + return WorkerPoolsRepository; +}(basicRepository_1.BasicRepository)); +exports.WorkerPoolsRepository = WorkerPoolsRepository; - return `Unknown error: ${JSON.stringify(data)}`; -} +/***/ }), -function withDefaults(oldEndpoint, newDefaults) { - const endpoint = oldEndpoint.defaults(newDefaults); +/***/ 91616: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - const newApi = function (route, parameters) { - const endpointOptions = endpoint.merge(route, parameters); +"use strict"; - if (!endpointOptions.request || !endpointOptions.request.hook) { - return fetchWrapper(endpoint.parse(endpointOptions)); +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.WorkerRepository = void 0; +var basicRepository_1 = __nccwpck_require__(30970); +var WorkerRepository = /** @class */ (function (_super) { + __extends(WorkerRepository, _super); + function WorkerRepository(client) { + return _super.call(this, "Workers", client) || this; } - - const request = (route, parameters) => { - return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters))); + WorkerRepository.prototype.discover = function (host, port, type, proxyId) { + return proxyId ? this.client.get(this.client.getLink("DiscoverWorker"), { host: host, port: port, type: type, proxyId: proxyId }) : this.client.get(this.client.getLink("DiscoverWorker"), { host: host, port: port, type: type }); }; - - Object.assign(request, { - endpoint, - defaults: withDefaults.bind(null, endpoint) - }); - 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 + WorkerRepository.prototype.getConnectionStatus = function (machine) { + return this.client.get(machine.Links["Connection"]); + }; + WorkerRepository.prototype.list = function (args) { + return this.client.get(this.client.getLink("Workers"), args); + }; + return WorkerRepository; +}(basicRepository_1.BasicRepository)); +exports.WorkerRepository = WorkerRepository; /***/ }), -/***/ 40937: +/***/ 43399: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AdapterError = void 0; -var AdapterError = /** @class */ (function () { - function AdapterError(code, message) { - this.code = code; - this.message = message; +exports.WorkerShellsRepository = void 0; +var WorkerShellsRepository = /** @class */ (function () { + function WorkerShellsRepository(client) { + this.client = client; } - return AdapterError; + WorkerShellsRepository.prototype.all = function () { + return this.client.get(this.client.getLink("WorkerShells")); + }; + return WorkerShellsRepository; }()); -exports.AdapterError = AdapterError; +exports.WorkerShellsRepository = WorkerShellsRepository; /***/ }), -/***/ 49018: +/***/ 871: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -4314,1060 +12610,1008 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AxiosAdapter = void 0; -var axios_1 = __importDefault(__nccwpck_require__(96545)); -var adapter_1 = __nccwpck_require__(40937); -var AxiosAdapter = /** @class */ (function () { - function AxiosAdapter() { +exports.Repository = void 0; +var _1 = __nccwpck_require__(80586); +var accountRepository_1 = __nccwpck_require__(9507); +var actionTemplateRepository_1 = __nccwpck_require__(67895); +var artifactRepository_1 = __nccwpck_require__(89463); +var authenticationRepository_1 = __nccwpck_require__(42583); +var buildInformationRepository_1 = __nccwpck_require__(7946); +var certificateConfigurationRepository_1 = __nccwpck_require__(4776); +var certificateRepository_1 = __nccwpck_require__(41266); +var channelRepository_1 = __nccwpck_require__(94659); +var cloudTemplateRepository_1 = __nccwpck_require__(94203); +var communityActionTemplateRepository_1 = __nccwpck_require__(69039); +var dashboardConfigurationRepository_1 = __nccwpck_require__(66446); +var dashboardRepository_1 = __nccwpck_require__(20009); +var defectRepository_1 = __nccwpck_require__(81630); +var deploymentRepository_1 = __nccwpck_require__(91848); +var dynamicExtensionRepository_1 = __nccwpck_require__(27848); +var environmentRepository_1 = __nccwpck_require__(8183); +var eventRepository_1 = __nccwpck_require__(65269); +var externalSecurityGroupProviderRepository_1 = __nccwpck_require__(22999); +var externalSecurityGroupRepository_1 = __nccwpck_require__(4387); +var externalUsersRepository_1 = __nccwpck_require__(55459); +var featuresConfigurationRepository_1 = __nccwpck_require__(56116); +var feedRepository_1 = __nccwpck_require__(20037); +var importExportActions_1 = __nccwpck_require__(18029); +var interruptionRepository_1 = __nccwpck_require__(90977); +var inviteRepository_1 = __nccwpck_require__(15228); +var letsEncryptConfigurationRepository_1 = __nccwpck_require__(78681); +var libraryVariableRepository_1 = __nccwpck_require__(64693); +var licenseRepository_1 = __nccwpck_require__(51916); +var lifecycleRepository_1 = __nccwpck_require__(56946); +var machinePolicyRepository_1 = __nccwpck_require__(154); +var machineRepository_1 = __nccwpck_require__(53015); +var machineRoleRepository_1 = __nccwpck_require__(50197); +var machineShellsRepository_1 = __nccwpck_require__(1939); +var maintenanceConfigurationRepository_1 = __nccwpck_require__(94772); +var octopusServerNodeRepository_1 = __nccwpck_require__(34819); +var packageRepository_1 = __nccwpck_require__(53378); +var performanceConfigurationRepository_1 = __nccwpck_require__(21797); +var permissionDescriptionRepository_1 = __nccwpck_require__(97886); +var progressionRepository_1 = __nccwpck_require__(53127); +var projectGroupRepository_1 = __nccwpck_require__(38331); +var projectRepository_1 = __importDefault(__nccwpck_require__(52058)); +var projectTriggerRepository_1 = __nccwpck_require__(57502); +var proxyRepository_1 = __nccwpck_require__(7358); +var releasesRepository_1 = __nccwpck_require__(87252); +var retentionDefaultConfigurationRepository_1 = __nccwpck_require__(11050); +var runbookProcessRepository_1 = __nccwpck_require__(82404); +var runbookRepository_1 = __nccwpck_require__(18312); +var runbookRunRepository_1 = __nccwpck_require__(30242); +var runbookSnapshotRepository_1 = __nccwpck_require__(73544); +var schedulerRepository_1 = __nccwpck_require__(63767); +var scopedUserRoleRepository_1 = __nccwpck_require__(18774); +var serverConfigurationRepository_1 = __nccwpck_require__(96489); +var serverStatusRepository_1 = __nccwpck_require__(84463); +var settingsRepository_1 = __importDefault(__nccwpck_require__(50924)); +var smtpConfigurationRepository_1 = __nccwpck_require__(7025); +var spaceRepository_1 = __nccwpck_require__(56836); +var subscriptionRepository_1 = __importDefault(__nccwpck_require__(94178)); +var tagSetRepository_1 = __importDefault(__nccwpck_require__(50450)); +var taskRepository_1 = __nccwpck_require__(53573); +var teamMembershipRepository_1 = __importDefault(__nccwpck_require__(30986)); +var teamRepository_1 = __nccwpck_require__(66168); +var tenantRepository_1 = __importDefault(__nccwpck_require__(54198)); +var tenantVariableRepository_1 = __importDefault(__nccwpck_require__(19652)); +var upgradeConfigurationRepository_1 = __nccwpck_require__(99284); +var userIdentityMetadataRepository_1 = __nccwpck_require__(67597); +var userOnBoardingRepository_1 = __nccwpck_require__(41025); +var userPermissionRepository_1 = __nccwpck_require__(27747); +var userRepository_1 = __importDefault(__nccwpck_require__(10895)); +var userRoleRepository_1 = __importDefault(__nccwpck_require__(74126)); +var variableRepository_1 = __importDefault(__nccwpck_require__(72887)); +var workerPoolsRepository_1 = __nccwpck_require__(65737); +var workerRepository_1 = __nccwpck_require__(91616); +var workerShellsRepository_1 = __nccwpck_require__(43399); +// Repositories provide a helpful abstraction around the Octopus Deploy API +var Repository = /** @class */ (function () { + function Repository(client) { + var _this = this; + this.client = client; + this.takeAll = 2147483647; + this.takeDefaultPageSize = 30; // Only used when we don't rely on the default that's applied server-side. + this.resolve = function (path, uriTemplateParameters) { return _this.client.resolve(path, uriTemplateParameters); }; + this.accounts = new accountRepository_1.AccountRepository(client); + this.actionTemplates = new actionTemplateRepository_1.ActionTemplateRepository(client); + this.artifacts = new artifactRepository_1.ArtifactRepository(client); + this.authentication = new authenticationRepository_1.AuthenticationRepository(client); + this.buildInformation = new buildInformationRepository_1.BuildInformationRepository(client); + this.certificateConfiguration = new certificateConfigurationRepository_1.CertificateConfigurationRepository(client); + this.certificates = new certificateRepository_1.CertificateRepository(client); + this.cloudTemplates = new cloudTemplateRepository_1.CloudTemplateRepository(client); + this.communityActionTemplates = new communityActionTemplateRepository_1.CommunityActionTemplateRepository(client); + this.dashboardConfiguration = new dashboardConfigurationRepository_1.DashboardConfigurationRepository(client); + this.dashboards = new dashboardRepository_1.DashboardRepository(client); + this.defects = new defectRepository_1.DefectRepository(client); + this.deployments = new deploymentRepository_1.DeploymentRepository(client); + this.dynamicExtensions = new dynamicExtensionRepository_1.DynamicExtensionRepository(client); + this.environments = new environmentRepository_1.EnvironmentRepository(client); + this.events = new eventRepository_1.EventRepository(client); + this.externalSecurityGroupProviders = new externalSecurityGroupProviderRepository_1.ExternalSecurityGroupProviderRepository(client); + this.externalSecurityGroups = new externalSecurityGroupRepository_1.ExternalSecurityGroupRepository(client); + this.externalUsers = new externalUsersRepository_1.ExternalUsersRepository(client); + this.featuresConfiguration = new featuresConfigurationRepository_1.FeaturesConfigurationRepository(client); + this.feeds = new feedRepository_1.FeedRepository(client); + this.importExport = new importExportActions_1.ImportExportActions(client); + this.interruptions = new interruptionRepository_1.InterruptionRepository(client); + this.invitations = new inviteRepository_1.InvitationRepository(client); + this.letsEncryptConfiguration = new letsEncryptConfigurationRepository_1.LetsEncryptConfigurationRepository(client); + this.libraryVariableSets = new libraryVariableRepository_1.LibraryVariableRepository(client); + this.licenses = new licenseRepository_1.LicenseRepository(client); + this.lifecycles = new lifecycleRepository_1.LifecycleRepository(client); + this.machinePolicies = new machinePolicyRepository_1.MachinePolicyRepository(client); + this.machineRoles = new machineRoleRepository_1.MachineRoleRepository(client); + this.machineShells = new machineShellsRepository_1.MachineShellsRepository(client); + this.machines = new machineRepository_1.MachineRepository(client); + this.maintenanceConfiguration = new maintenanceConfigurationRepository_1.MaintenanceConfigurationRepository(client); + this.octopusServerNodes = new octopusServerNodeRepository_1.OctopusServerNodeRepository(client); + this.retentionDefaultConfiguration = new retentionDefaultConfigurationRepository_1.RetentionDefaultConfigurationRepository(client); + this.runbooks = new runbookRepository_1.RunbookRepository(client); + this.runbookProcess = new runbookProcessRepository_1.RunbookProcessRepository(client); + this.runbookSnapshots = new runbookSnapshotRepository_1.RunbookSnapshotRepository(client); + this.runbookRuns = new runbookRunRepository_1.RunbookRunRepository(client); + this.packages = new packageRepository_1.PackageRepository(client); + this.performanceConfiguration = new performanceConfigurationRepository_1.PerformanceConfigurationRepository(client); + this.permissionDescriptions = new permissionDescriptionRepository_1.PermissionDescriptionRepository(client); + this.progression = new progressionRepository_1.ProgressionRepository(client); + this.projectGroups = new projectGroupRepository_1.ProjectGroupRepository(client); + this.projects = new projectRepository_1.default(client); + this.channels = new channelRepository_1.ChannelRepository(this.projects, client); + this.deploymentProcesses = new _1.DeploymentProcessRepository(this.projects, client); + this.projectTriggers = new projectTriggerRepository_1.ProjectTriggerRepository(client); + this.proxies = new proxyRepository_1.ProxyRepository(client); + this.releases = new releasesRepository_1.ReleasesRepository(client); + this.scheduler = new schedulerRepository_1.SchedulerRepository(client); + this.scopedUserRoles = new scopedUserRoleRepository_1.ScopedUserRoleRepository(client); + this.serverStatus = new serverStatusRepository_1.ServerStatusRepository(client); + this.serverConfiguration = new serverConfigurationRepository_1.ServerConfigurationRepository(client); + this.settings = new settingsRepository_1.default(client); + this.smtpConfiguration = new smtpConfigurationRepository_1.SmtpConfigurationRepository(client); + this.spaces = new spaceRepository_1.SpaceRepository(client); + this.subscriptions = new subscriptionRepository_1.default(client); + this.tagSets = new tagSetRepository_1.default(client); + this.tasks = new taskRepository_1.TaskRepository(client); + this.teams = new teamRepository_1.TeamRepository(client); + this.tenants = new tenantRepository_1.default(client); + this.tenantVariables = new tenantVariableRepository_1.default(client); + this.upgradeConfiguration = new upgradeConfigurationRepository_1.UpgradeConfigurationRepository(client); + this.userIdentityMetadata = new userIdentityMetadataRepository_1.UserIdentityMetadataRepository(client); + this.userOnboarding = new userOnBoardingRepository_1.UserOnBoardingRepository(client); + this.userPermissions = new userPermissionRepository_1.UserPermissionRepository(client); + this.teamMembership = new teamMembershipRepository_1.default(client); + this.userRoles = new userRoleRepository_1.default(client); + this.users = new userRepository_1.default(client); + this.variables = new variableRepository_1.default(client); + this.getServerInformation = client.getServerInformation.bind(client); + this.workerPools = new workerPoolsRepository_1.WorkerPoolsRepository(client); + this.workerShells = new workerShellsRepository_1.WorkerShellsRepository(client); + this.workers = new workerRepository_1.WorkerRepository(client); } - AxiosAdapter.prototype.execute = function (options) { - var _a, _b; + Object.defineProperty(Repository.prototype, "spaceId", { + get: function () { + return this.client.spaceId; + }, + enumerable: false, + configurable: true + }); + Repository.prototype.forSpace = function (space) { return __awaiter(this, void 0, void 0, function () { - function formatError(response) { - if (!response.data) { - return undefined; - } - var message = response.data.ErrorMessage; - if (response.data.Errors) { - var errors = response.data.Errors; - for (var i = 0; i < errors.length; i++) { - message += "\n".concat(errors[i]); - } - } - return message; - } - var config, response, error_1; - return __generator(this, function (_c) { - switch (_c.label) { + var _a; + return __generator(this, function (_b) { + switch (_b.label) { case 0: - _c.trys.push([0, 2, , 3]); - config = { - httpsAgent: options.configuration.agent, - url: options.url, - method: options.method, - data: options.requestBody, - headers: { - "X-Octopus-ApiKey": (_a = options.configuration.apiKey) !== null && _a !== void 0 ? _a : "", - }, - responseType: "json", - }; - if (typeof XMLHttpRequest === "undefined") { - if (config.headers) { - config.headers["User-Agent"] = "ts-octopusdeploy"; - } - } - return [4 /*yield*/, axios_1.default.request(config)]; - case 1: - response = _c.sent(); - return [2 /*return*/, { - data: response.data, - statusCode: response.status, - }]; - case 2: - error_1 = _c.sent(); - if (axios_1.default.isAxiosError(error_1) && error_1.response) { - throw new adapter_1.AdapterError(error_1.response.status, (_b = formatError(error_1.response)) !== null && _b !== void 0 ? _b : error_1.message); - } - else { - throw error_1; - } - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; + if (!(this.spaceId !== space.Id)) return [3 /*break*/, 2]; + _a = Repository.bind; + return [4 /*yield*/, this.client.forSpace(space.Id)]; + case 1: return [2 /*return*/, new (_a.apply(Repository, [void 0, _b.sent()]))()]; + case 2: return [2 /*return*/, this]; } }); }); }; - return AxiosAdapter; + Repository.prototype.forSystem = function () { + return new Repository(this.client.forSystem()); + }; + Repository.prototype.switchToSpace = function (spaceIdOrName) { + return this.client.switchToSpace(spaceIdOrName); + }; + Repository.prototype.switchToSystem = function () { + this.client.switchToSystem(); + }; + return Repository; }()); -exports.AxiosAdapter = AxiosAdapter; +exports.Repository = Repository; /***/ }), -/***/ 51542: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 15435: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 28043: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable @typescript-eslint/consistent-type-assertions */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Resolver = void 0; +var URI = __nccwpck_require__(34190); +var URITemplate = __nccwpck_require__(23423); +var Resolver = /** @class */ (function () { + function Resolver(baseUri) { + this.baseUri = baseUri; + this.baseUri = this.baseUri.endsWith("/") ? this.baseUri : this.baseUri + "/"; + var lastIndexOfMandatorySegment = this.baseUri.lastIndexOf("/api/"); + if (lastIndexOfMandatorySegment >= 1) { + this.baseUri = this.baseUri.substring(0, lastIndexOfMandatorySegment); + } + else { + if (this.baseUri.endsWith("/api")) { + this.baseUri = this.baseUri.substring(0, -4); } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + this.baseUri = this.baseUri.endsWith("/") ? this.baseUri.substring(0, this.baseUri.length - 1) : this.baseUri; + var parsed = URI(this.baseUri); + this.rootUri = parsed.scheme() + "://" + parsed.authority(); + this.rootUri = this.rootUri.endsWith("/") ? this.rootUri.substring(0, this.rootUri.length - 1) : this.rootUri; } -}; + Resolver.prototype.resolve = function (path, uriTemplateParameters) { + if (!path) { + throw new Error("The link is not set to a value"); + } + if (path.startsWith("~/")) { + path = path.substring(1, path.length); + path = this.baseUri + path; + } + else { + path = this.rootUri + path; + } + var template = new URITemplate(path); + var result = template.expand(uriTemplateParameters || {}); + return result; + }; + return Resolver; +}()); +exports.Resolver = Resolver; + + +/***/ }), + +/***/ 82138: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + Object.defineProperty(exports, "__esModule", ({ value: true })); -var message_contracts_1 = __nccwpck_require__(74561); -var adapter_1 = __nccwpck_require__(40937); -var axiosAdapter_1 = __nccwpck_require__(49018); -var ApiClient = /** @class */ (function () { - function ApiClient(options) { - var _this = this; - this.handleSuccess = function (response) { - if (_this.options.onResponseCallback) { - var details = { - method: _this.options.method, - url: _this.options.url, - statusCode: response.statusCode, - }; - _this.options.onResponseCallback(details); - } - var responseText = ""; - if (_this.options.raw) { - responseText = response.data; - } - else { - responseText = JSON.stringify(response.data); - if (responseText && responseText.length > 0) { - responseText = JSON.parse(responseText); - } - } - _this.options.success(responseText); - }; - this.handleError = function (requestError) { - var err = generateOctopusError(requestError); - if (_this.options.onErrorResponseCallback) { - var details = { - method: _this.options.method, - url: _this.options.url, - statusCode: err.StatusCode, - errorMessage: err.ErrorMessage, - errors: err.Errors, - }; - _this.options.onErrorResponseCallback(details); - } - _this.options.error(err); - }; - this.options = options; - this.adapter = new axiosAdapter_1.AxiosAdapter(); + + +/***/ }), + +/***/ 60232: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 445: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable no-eq-null */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Session = void 0; +var userPermissions_1 = __nccwpck_require__(54663); +var Session = /** @class */ (function () { + function Session() { + this.currentUser = undefined; + this.currentPermissions = undefined; } - ApiClient.prototype.execute = function () { - return __awaiter(this, void 0, void 0, function () { - var response, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, this.adapter.execute(this.options)]; - case 1: - response = _a.sent(); - this.handleSuccess(response); - return [3 /*break*/, 3]; - case 2: - error_1 = _a.sent(); - if (error_1 instanceof adapter_1.AdapterError) { - this.handleError(error_1); - } - else if (error_1 instanceof Error) { - this.options.error(error_1); - } - else { - this.options.error(Error("An unknown error occurred: ".concat(error_1))); - } - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); + Session.prototype.start = function (user, features) { + console.info("Starting session for ".concat(user.DisplayName, " user.")); + this.currentUser = user; + }; + Session.prototype.end = function () { + if (this.currentUser) { + console.info("Ending session for ".concat(this.currentUser.DisplayName, " user.")); + } + this.currentUser = null; + this.currentPermissions = null; + }; + Session.prototype.refreshPermissions = function (userPermission) { + this.currentPermissions = userPermissions_1.UserPermissions.Create(userPermission.SpacePermissions, userPermission.SystemPermissions, userPermission.Teams); + }; + Session.prototype.isAuthenticated = function () { + return this.currentUser != null; }; - return ApiClient; + return Session; }()); -exports["default"] = ApiClient; -var deserialize = function (responseText, raw, forceJson) { - if (forceJson === void 0) { forceJson = false; } - if (raw && !forceJson) - return responseText; - if (responseText && responseText.length) - return JSON.parse(responseText); - return null; -}; -var generateOctopusError = function (requestError) { - if (requestError.code) { - var code = requestError.code; - return new message_contracts_1.OctopusError(code, requestError.message); - } - return new message_contracts_1.OctopusError(0, requestError.message); -}; +exports.Session = Session; +exports["default"] = Session; /***/ }), -/***/ 63024: +/***/ 31547: /***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable @typescript-eslint/no-non-null-assertion */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/init-declarations */ Object.defineProperty(exports, "__esModule", ({ value: true })); -var MAX_MEMORY = (Math.pow(1024, 2) * 1000) / 2; //1GB /2 (1 character in js is 2 bytes) -var Caching = /** @class */ (function () { - function Caching(options) { - this.cache = {}; - options = options || { - maxMemory: MAX_MEMORY, - }; - this.maxMemory = options.maxMemory; - this.dataVersionHeader = "X-Octopus-Data-Version"; - this.authorizationHashHeader = "X-Octopus-Authorization-Hash"; +exports.SubscriptionRecord = void 0; +var SubscriptionRecord = /** @class */ (function () { + function SubscriptionRecord() { + this.subscriptions = {}; } - Caching.prototype.clearAll = function () { - this.cache = {}; + SubscriptionRecord.prototype.subscribe = function (registrationName, callback) { + var _this = this; + this.subscriptions[registrationName] = callback; + return function () { return _this.unsubscribe(registrationName); }; }; - Caching.prototype.setHeaderAndGetValue = function (request, options) { - if (this.cache[options.url]) { - request.setRequestHeader(this.dataVersionHeader, this.cache[options.url].dataVersion); - request.setRequestHeader(this.authorizationHashHeader, this.cache[options.url].authorizationHash); - this.cache[options.url].lastAccessed = new Date(); - return this.cache[options.url].value; - } + SubscriptionRecord.prototype.unsubscribe = function (registrationName) { + delete this.subscriptions[registrationName]; }; - Caching.prototype.updateCache = function (request, options) { - try { - var dataVersion = request.getResponseHeader(this.dataVersionHeader); - var authorizationHash = request.getResponseHeader(this.authorizationHashHeader); - if (!!dataVersion && !!authorizationHash) { - var item = { - dataVersion: dataVersion, - authorizationHash: authorizationHash, - lastAccessed: new Date(), - value: request.responseText, - }; - var itemSize = this.itemSizeInMemory(options.url, item); - if (itemSize < this.maxMemory) { - this.cache[options.url] = item; - } - this.memoryPressureCleanup(); - } - else { - delete this.cache[options.url]; - } - } - catch (e) { - delete this.cache[options.url]; - } + SubscriptionRecord.prototype.notify = function (predicate, data) { + var _this = this; + Object.keys(this.subscriptions) + .filter(predicate) + .forEach(function (key) { return _this.subscriptions[key](data); }); }; - Caching.prototype.canUseCachedValue = function (request) { - return request.status === 304 && (request.responseText === "" || !request.responseText); + SubscriptionRecord.prototype.notifyAll = function (data) { + this.notify(function () { return true; }, data); }; - Caching.prototype.memoryPressureCleanup = function () { - var currentMemory = this.roughSizeOfReleasableMemory(); - while (currentMemory >= this.maxMemory) { - this.removeOldest(); - var newMemoryLevel = this.roughSizeOfReleasableMemory(); - if (newMemoryLevel === currentMemory) { - // Just make sure we don't get stuck. - return; - } - currentMemory = newMemoryLevel; + SubscriptionRecord.prototype.notifySingle = function (registrationName, data) { + if (registrationName in this.subscriptions) { + this.subscriptions[registrationName](data); } }; - Caching.prototype.itemSizeInMemory = function (url, item) { - return url.length + item.value.length; - }; - Caching.prototype.removeOldest = function () { - var _this = this; - var oldestUrl; - var oldestResponded = -1; - var now = new Date(); - Object.keys(this.cache).forEach(function (url) { - var age = now.valueOf() - _this.cache[url].lastAccessed.valueOf(); - if (age > oldestResponded) { - oldestResponded = age; - oldestUrl = url; - } - }); - delete this.cache[oldestUrl]; - }; - Caching.prototype.roughSizeOfReleasableMemory = function () { - var _this = this; - return Object.keys(this.cache).reduce(function (total, url) { - var item = _this.cache[url]; - return total + _this.itemSizeInMemory(url, item); - }, 0); - }; - return Caching; + return SubscriptionRecord; }()); -exports["default"] = Caching; +exports.SubscriptionRecord = SubscriptionRecord; /***/ }), -/***/ 42399: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 54663: +/***/ ((__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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; +/* eslint-disable no-eq-null */ +/* eslint-disable @typescript-eslint/consistent-type-assertions */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Client = void 0; -var apiClient_1 = __importDefault(__nccwpck_require__(51542)); -var clientConfiguration_1 = __nccwpck_require__(5966); -var environment_1 = __importDefault(__nccwpck_require__(96050)); -var resolver_1 = __nccwpck_require__(28043); -var subscriptionRecord_1 = __nccwpck_require__(31547); -var apiLocation = "~/api"; -// The Octopus Client implements the low-level semantics of the Octopus Deploy REST API -var Client = /** @class */ (function () { - function Client(session, resolver, rootDocument, spaceId, spaceRootDocument, configuration) { - var _this = this; - this.session = session; - this.resolver = resolver; - this.rootDocument = rootDocument; - this.spaceId = spaceId; - this.spaceRootDocument = spaceRootDocument; - this.configuration = configuration; - this.requestSubscriptions = new subscriptionRecord_1.SubscriptionRecord(); - this.responseSubscriptions = new subscriptionRecord_1.SubscriptionRecord(); - this.errorSubscriptions = new subscriptionRecord_1.SubscriptionRecord(); - this.onRequestCallback = undefined; - this.onResponseCallback = undefined; - this.onErrorResponseCallback = undefined; - this.debug = function (message) { - _this.logger.debug && _this.logger.debug(message); - }; - this.info = function (message) { - _this.logger.info && _this.logger.info(message); - }; - this.warn = function (message) { - _this.logger.warn && _this.logger.warn(message); - }; - this.error = function (message, error) { - if (error === void 0) { error = undefined; } - _this.logger.error && _this.logger.error(message, error); - }; - this.subscribeToRequests = function (registrationName, callback) { - return _this.requestSubscriptions.subscribe(registrationName, callback); - }; - this.subscribeToResponses = function (registrationName, callback) { - return _this.responseSubscriptions.subscribe(registrationName, callback); - }; - this.subscribeToErrors = function (registrationName, callback) { - return _this.errorSubscriptions.subscribe(registrationName, callback); - }; - this.setOnRequestCallback = function (callback) { - _this.onRequestCallback = callback; - }; - this.setOnResponseCallback = function (callback) { - _this.onResponseCallback = callback; - }; - this.setOnErrorResponseCallback = function (callback) { - _this.onErrorResponseCallback = callback; - }; - this.resolve = function (path, uriTemplateParameters) { return _this.resolver.resolve(path, uriTemplateParameters); }; - this.configuration = configuration; - this.logger = __assign({ - debug: function (message) { return console.debug(message); }, - info: function (message) { return console.info(message); }, - warn: function (message) { return console.warn(message); }, - error: function (message, err) { - if (err !== undefined) { - console.error(err.message); - } - else { - console.error(message); - } - }, - }, configuration.logging); - this.resolver = resolver; - this.rootDocument = rootDocument; - this.spaceRootDocument = spaceRootDocument; +exports.isAccessToAllProjectGroups = exports.isAccessToAllTenants = exports.isAccessToAllEnvironments = exports.isAccessToAllProjects = exports.UserPermissions = void 0; +var message_contracts_1 = __nccwpck_require__(74561); +var UserPermissions = /** @class */ (function () { + function UserPermissions(spacePermissions, systemPermissions, teams) { + this.spacePermissions = spacePermissions; + this.systemPermissions = systemPermissions; + this.teams = teams; } - Client.create = function (configuration) { - return __awaiter(this, void 0, void 0, function () { - var resolver, client, error_1, error_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - configuration = (0, clientConfiguration_1.processConfiguration)(configuration); - if (!configuration.apiUri) { - throw new Error("The host is not specified"); - } - resolver = new resolver_1.Resolver(configuration.apiUri); - client = new Client(null, resolver, null, null, null, configuration); - if (!configuration.autoConnect) return [3 /*break*/, 8]; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, client.connect(function (message, error) { - client.debug("Attempting to connect to API endpoint..."); - })]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - error_1 = _a.sent(); - if (error_1 instanceof Error) - client.error("Could not connect", error_1); - throw error_1; - case 4: - if (!(configuration.space !== null && configuration.space !== undefined)) return [3 /*break*/, 8]; - _a.label = 5; - case 5: - _a.trys.push([5, 7, , 8]); - return [4 /*yield*/, client.switchToSpace(configuration.space)]; - case 6: - _a.sent(); - return [3 /*break*/, 8]; - case 7: - error_2 = _a.sent(); - if (error_2 instanceof Error) - client.error("Could not switch to space", error_2); - throw error_2; - case 8: return [2 /*return*/, client]; - } - }); - }); - }; - Client.prototype.connect = function (progressCallback) { - var _this = this; - progressCallback("Checking credentials..."); - return new Promise(function (resolve, reject) { - if (_this.rootDocument) { - resolve(); - return; - } - var attempt = function (success, fail) { - _this.get(apiLocation).then(function (root) { - success(root); - }, fail); - }; - var onSuccess = function (root) { - _this.rootDocument = root; - resolve(); - }; - var onFail = function (err) { - progressCallback("Unable to connect.", err); - reject(err); - }; - attempt(onSuccess, onFail); - }); - }; - Client.prototype.disconnect = function () { - this.rootDocument = null; - this.spaceId = null; - this.spaceRootDocument = null; - }; - Client.prototype.forSpace = function (spaceId) { - return __awaiter(this, void 0, void 0, function () { - var spaceRootResource; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.get(this.rootDocument.Links["SpaceHome"], { spaceId: spaceId })]; - case 1: - spaceRootResource = _a.sent(); - return [2 /*return*/, new Client(this.session, this.resolver, this.rootDocument, spaceId, spaceRootResource, this.configuration)]; + UserPermissions.Create = function (spacePermissions, systemPermissions, teams) { + var ps = {}; + Object.keys(spacePermissions).forEach(function (permission) { + var permissionRestrictionInAllSpaces = spacePermissions[permission]; + permissionRestrictionInAllSpaces.forEach(function (permissionRestriction) { + var permissionsForSpace = ps[permissionRestriction.SpaceId]; + if (!permissionsForSpace) { + ps[permissionRestriction.SpaceId] = {}; } - }); - }); - }; - Client.prototype.forSystem = function () { - return new Client(this.session, this.resolver, this.rootDocument, null, null, this.configuration); - }; - Client.prototype.switchToSpace = function (spaceId) { - return __awaiter(this, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (this.rootDocument === null) { - throw new Error("Root document is null; this document is required for the API client. Please ensure that the API endpoint is accessible along with its root document."); - } - this.spaceId = spaceId; - _a = this; - return [4 /*yield*/, this.get(this.rootDocument.Links["SpaceHome"], { spaceId: this.spaceId })]; - case 1: - _a.spaceRootDocument = _b.sent(); - return [2 /*return*/]; + var internalPermission = convertUserPermissionRestrictionToInternalPermissions(permissionRestriction); + var restrictionsWithinSpace = ps[permissionRestriction.SpaceId][permission.toLowerCase()]; + if (!restrictionsWithinSpace) { + ps[permissionRestriction.SpaceId][permission.toLowerCase()] = []; } + ps[permissionRestriction.SpaceId][permission.toLowerCase()].push(internalPermission); }); }); + return new UserPermissions(ps, systemPermissions.map(function (p) { return p.toLowerCase(); }), teams); }; - Client.prototype.switchToSystem = function () { - this.spaceId = null; - this.spaceRootDocument = null; - }; - Client.prototype.get = function (path, args) { - if (path === undefined) - return {}; - var url = this.resolveUrlWithSpaceId(path, args); - return this.dispatchRequest("GET", url); - }; - Client.prototype.getRaw = function (path, args) { - var _this = this; - var url = this.resolve(path, args); - return new Promise(function (resolve, reject) { - new apiClient_1.default({ - configuration: _this.configuration, - session: _this.session, - url: url, - method: "GET", - error: function (e) { return reject(e); }, - raw: true, - success: function (data) { return resolve(data); }, - tryGetServerInformation: function () { return _this.tryGetServerInformation(); }, - getAntiForgeryTokenCallback: function () { return _this.getAntiforgeryToken(); }, - onRequestCallback: function (r) { return _this.onRequest(r); }, - onResponseCallback: function (r) { return _this.onResponse(r); }, - onErrorResponseCallback: function (r) { return _this.onErrorResponse(r); }, - }).execute(); - }); - }; - Client.prototype.onRequest = function (clientRequestDetails) { - var details = { - url: clientRequestDetails.url, - method: clientRequestDetails.method, - }; - if (this.onRequestCallback) { - this.onRequestCallback(details); - } - this.requestSubscriptions.notifyAll(details); - }; - Client.prototype.onResponse = function (clientResponseDetails) { - var details = { - url: clientResponseDetails.url, - method: clientResponseDetails.method, - statusCode: clientResponseDetails.statusCode, - }; - if (this.onResponseCallback) { - this.onResponseCallback(details); - } - this.responseSubscriptions.notifyAll(details); - }; - Client.prototype.onErrorResponse = function (clientErrorResponseDetails) { - var details = { - url: clientErrorResponseDetails.url, - method: clientErrorResponseDetails.method, - statusCode: clientErrorResponseDetails.statusCode, - errorMessage: clientErrorResponseDetails.errorMessage, - errors: clientErrorResponseDetails.errors, - }; - if (this.onErrorResponseCallback) { - this.onErrorResponseCallback(details); - } - this.errorSubscriptions.notifyAll(details); - }; - Client.prototype.post = function (path, resource, args) { - var url = this.resolveUrlWithSpaceId(path, args); - return this.dispatchRequest("POST", url, resource); - }; - Client.prototype.create = function (path, resource, args) { - var _this = this; - var url = this.resolve(path, args); - return new Promise(function (resolve, reject) { - _this.dispatchRequest("POST", url, resource).then(function (result) { - var _a; - var selfLink = (_a = result.Links) === null || _a === void 0 ? void 0 : _a.Self; - if (selfLink) { - var result2 = _this.get(selfLink); - resolve(result2); - return; - } - resolve(result); - }, reject); - }); - }; - Client.prototype.update = function (path, resource, args) { - var _this = this; - var url = this.resolve(path, args); - return new Promise(function (resolve, reject) { - _this.dispatchRequest("PUT", url, resource).then(function (result) { - var _a; - var selfLink = (_a = result.Links) === null || _a === void 0 ? void 0 : _a.Self; - if (selfLink) { - var result2 = _this.get(selfLink); - resolve(result2); - return; - } - resolve(result); - }, reject); - }); - }; - Client.prototype.del = function (path, resource, args) { - var url = this.resolve(path, args); - return this.dispatchRequest("DELETE", url, resource); - }; - Client.prototype.put = function (path, resource, args) { - var url = this.resolveUrlWithSpaceId(path, args); - return this.dispatchRequest("PUT", url, resource); + UserPermissions.prototype.scopeToSystem = function () { + return new UserPermissions({}, this.systemPermissions, this.teams); }; - Client.prototype.getAntiforgeryToken = function () { - if (!this.isConnected()) { - return null; - } - var installationId = this.getGlobalRootDocument().InstallationId; - if (!installationId) { - return null; - } - // If we have come this far we know we are on a version of Octopus Server which supports anti-forgery tokens - var antiforgeryCookieName = "Octopus-Csrf-Token_" + installationId; - var antiforgeryCookies = document.cookie - .split(";") - .filter(function (c) { - return c.trim().indexOf(antiforgeryCookieName) === 0; - }) - .map(function (c) { - return c.trim(); - }); - if (antiforgeryCookies && antiforgeryCookies.length === 1) { - var antiforgeryToken = antiforgeryCookies[0].split("=")[1]; - return antiforgeryToken; + UserPermissions.prototype.scopeToSpace = function (spaceId) { + var _a; + if (!spaceId) { + return new UserPermissions({}, [], this.teams); } - else { - if (environment_1.default.isInDevelopmentMode()) { - return "FAKE TOKEN USED FOR DEVELOPMENT"; - } - return null; + var permissionsForSpace = this.spacePermissions[spaceId] || {}; + return new UserPermissions((_a = {}, _a[spaceId] = permissionsForSpace, _a), [], this.teams); + }; + UserPermissions.prototype.scopeToSpaceAndSystem = function (spaceId) { + var _a; + if (!spaceId) { + return new UserPermissions({}, this.systemPermissions, this.teams); } + var permissionsForSpace = this.spacePermissions[spaceId] || {}; + return new UserPermissions((_a = {}, _a[spaceId] = permissionsForSpace, _a), this.systemPermissions, this.teams); }; - Client.prototype.resolveLinkTemplate = function (link, args) { - return this.resolve(this.getLink(link), args); + UserPermissions.prototype.hasAnyPermissions = function () { + var _this = this; + var hasAnySpacePermissions = Object.keys(this.spacePermissions).some(function (spaceId) { + return Object.keys(_this.spacePermissions[spaceId]).length > 0; + }); + var hasAnySystemPermissions = this.systemPermissions.length > 0; + return hasAnySpacePermissions || hasAnySystemPermissions; }; - Client.prototype.getServerInformation = function () { - if (!this.isConnected()) { - throw new Error("The Octopus Client has not connected. THIS SHOULD NOT HAPPEN! Please notify support."); - } - return { - version: this.rootDocument.Version, - }; + UserPermissions.prototype.firstAuthorized = function (permissions) { + var _this = this; + return permissions.find(function (p) { + return _this.hasSpacePermission(p) || _this.hasSystemPermission(p); + }); }; - Client.prototype.tryGetServerInformation = function () { - return this.rootDocument - ? { - version: this.rootDocument.Version, - installationId: this.rootDocument.InstallationId, - } - : null; + UserPermissions.prototype.hasPermissionInAnyScope = function (permission) { + return this.hasSpacePermission(permission) || this.hasSystemPermission(permission); }; - Client.prototype.throwIfClientNotConnected = function () { - if (!this.isConnected()) { - var errorMessage = "Can't get the link from the client, because the client has not yet been connected."; - throw new Error(errorMessage); + UserPermissions.prototype.isAuthorized = function (authorization) { + var isInSystemPermissions = this.systemPermissions.includes(authorization.permission.toLowerCase()); + if (isInSystemPermissions) { + // these are not scoped, so if the permission is here, we're done they are Authorized + return true; } + return this.isAuthorizedInAnySpace(authorization); }; - Client.prototype.getSystemLink = function (linkGetter) { - this.throwIfClientNotConnected(); - var link = linkGetter(this.rootDocument.Links); - if (link === null) { - var errorMessage = "Can't get the link for ".concat(name, " from the client, because it could not be found in the root document."); - throw new Error(errorMessage); + UserPermissions.prototype.isAuthorizedInAnySpace = function (authorization) { + var _this = this; + return Object.keys(this.spacePermissions).some(function (spaceId) { + return isAuthorizedInSpecificSpace(_this.spacePermissions[spaceId]); + }); + function isAuthorizedInSpecificSpace(specificSpacePermissions) { + var restrictions = specificSpacePermissions[authorization.permission.toLowerCase()]; + if (!restrictions) { + // User doesn't have the permission in any scope + return false; + } + if (restrictions.length === 0) { + // No restrictions + return true; + } + for (var _i = 0, restrictions_1 = restrictions; _i < restrictions_1.length; _i++) { + var restriction = restrictions_1[_i]; + var allowed = true; + if (!isAccessToAllProjects(restriction.projectIds)) { + if (authorization.projectId == null || (!isWildcard(authorization.projectId) && !restriction.projectIds.includes(authorization.projectId.toLowerCase()))) { + allowed = false; + } + } + if (!isAccessToAllEnvironments(restriction.environmentIds)) { + if (authorization.environmentId == null || (!isWildcard(authorization.environmentId) && !restriction.environmentIds.includes(authorization.environmentId.toLowerCase()))) { + allowed = false; + } + } + if (!isAccessToAllProjectGroups(restriction.projectGroupIds)) { + if (authorization.projectGroupId == null || (!isWildcard(authorization.projectGroupId) && !restriction.projectGroupIds.includes(authorization.projectGroupId.toLowerCase()))) { + allowed = false; + } + } + if (!isAccessToAllTenants(restriction.tenantIds)) { + if (authorization.tenantId == null || (!isWildcard(authorization.tenantId) && !restriction.tenantIds.includes(authorization.tenantId.toLowerCase()))) { + allowed = false; + } + } + if (allowed) { + return true; + } + } + return false; + function isWildcard(s) { + return s === "*"; + } } - return link; }; - Client.prototype.getLink = function (name) { - this.throwIfClientNotConnected(); - var spaceLinkExists = this.spaceRootDocument && this.spaceRootDocument.Links !== undefined && this.spaceRootDocument.Links[name]; - var link = spaceLinkExists ? this.spaceRootDocument.Links[name] : this.rootDocument.Links[name]; - if (!link) { - var errorMessage = "Can't get the link for ".concat(name, " from the client, because it could not be found in the root document or the space root document."); - throw new Error(errorMessage); - } - return link; + UserPermissions.prototype.isSpaceManager = function (space) { + var _this = this; + return space && space.SpaceManagersTeams.some(function (t) { return _this.teams.some(function (cpt) { return cpt.Id === t; }); }); }; - Client.prototype.dispatchRequest = function (method, url, requestBody) { + UserPermissions.prototype.hasSpacePermission = function (permission) { var _this = this; - return new Promise(function (resolve, reject) { - new apiClient_1.default({ - configuration: _this.configuration, - session: _this.session, - error: function (e) { return reject(e); }, - method: method, - url: url, - requestBody: requestBody, - success: function (data) { return resolve(data); }, - tryGetServerInformation: function () { return _this.tryGetServerInformation(); }, - getAntiForgeryTokenCallback: function () { return _this.getAntiforgeryToken(); }, - onRequestCallback: function (r) { return _this.onRequest(r); }, - onResponseCallback: function (r) { return _this.onResponse(r); }, - onErrorResponseCallback: function (r) { return _this.onErrorResponse(r); }, - }).execute(); + var lowerCasePermission = permission.toLowerCase(); + return Object.keys(this.spacePermissions).some(function (spaceId) { + return !!_this.spacePermissions[spaceId][lowerCasePermission]; }); }; - Client.prototype.isConnected = function () { - return this.rootDocument !== null; + UserPermissions.prototype.hasSystemPermission = function (permission) { + return this.systemPermissions.includes(permission.toLowerCase()); }; - Client.prototype.getArgsWithSpaceId = function (args) { - return this.spaceId ? __assign({ spaceId: this.spaceId }, args) : args; + return UserPermissions; +}()); +exports.UserPermissions = UserPermissions; +// This type is distinct from `UserPermissionRestriction` because it is safer to have the "all" case represented by a non-array +// It is harder to make type mistakes this way, since you should be unable to assign the "all" string value to the array representing a subset of values +function convertUserPermissionRestrictionToInternalPermissions(permissionRestriction) { + var normalizedProjectRestrictions = (0, message_contracts_1.isAllProjects)(permissionRestriction.RestrictedToProjectIds) ? "Access to all projects" : permissionRestriction.RestrictedToProjectIds.map(function (id) { return id.toLowerCase(); }); + var normalizedEnvironmentRestrictions = (0, message_contracts_1.isAllEnvironments)(permissionRestriction.RestrictedToEnvironmentIds) + ? "Access to all environments" + : permissionRestriction.RestrictedToEnvironmentIds.map(function (id) { return id.toLowerCase(); }); + var normalizedProjectGroupIds = (0, message_contracts_1.isAllProjectGroups)(permissionRestriction.RestrictedToProjectGroupIds) + ? "Access to all project groups" + : permissionRestriction.RestrictedToProjectGroupIds.map(function (id) { return id.toLowerCase(); }); + var normalizedTenantIds = (0, message_contracts_1.isAllTenants)(permissionRestriction.RestrictedToTenantIds) ? "Access to all tenants" : permissionRestriction.RestrictedToTenantIds.map(function (id) { return id.toLowerCase(); }); + return { + projectIds: normalizedProjectRestrictions, + environmentIds: normalizedEnvironmentRestrictions, + projectGroupIds: normalizedProjectGroupIds, + tenantIds: normalizedTenantIds, }; - Client.prototype.getGlobalRootDocument = function () { - if (!this.isConnected()) { - throw new Error("The Octopus Client has not connected."); +} +function isAccessToAllProjects(restrictions) { + var accessToAllProjects = restrictions; + return typeof accessToAllProjects === "string" && accessToAllProjects === "Access to all projects"; +} +exports.isAccessToAllProjects = isAccessToAllProjects; +function isAccessToAllEnvironments(restrictions) { + var accessToAllEnvironments = restrictions; + return typeof accessToAllEnvironments === "string" && accessToAllEnvironments === "Access to all environments"; +} +exports.isAccessToAllEnvironments = isAccessToAllEnvironments; +function isAccessToAllTenants(restrictions) { + var accessToAllTenants = restrictions; + return typeof accessToAllTenants === "string" && accessToAllTenants === "Access to all tenants"; +} +exports.isAccessToAllTenants = isAccessToAllTenants; +function isAccessToAllProjectGroups(restrictions) { + var accessToAllProjectGroups = restrictions; + return typeof accessToAllProjectGroups === "string" && accessToAllProjectGroups === "Access to all project groups"; +} +exports.isAccessToAllProjectGroups = isAccessToAllProjectGroups; + + +/***/ }), + +/***/ 47132: +/***/ (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.isPropertyDefinedAndNotNull = exports.typeSafeHasOwnProperty = exports.ensureSuffix = exports.ensurePrefix = exports.determineServerEndpoint = exports.getResolver = exports.getServerEndpoint = exports.getQueryValue = void 0; +var lodash_1 = __nccwpck_require__(90250); +var urijs_1 = __importDefault(__nccwpck_require__(34190)); +var resolver_1 = __nccwpck_require__(28043); +var getQueryValue = function (key, location) { + var result; + (0, urijs_1.default)(location).hasQuery(key, function (value) { + result = value; + }); + return result; +}; +exports.getQueryValue = getQueryValue; +var getServerEndpoint = function (location) { + if (location === void 0) { location = window.location; } + return (0, exports.getQueryValue)("octopus.server", location.href) || (0, exports.determineServerEndpoint)(location); +}; +exports.getServerEndpoint = getServerEndpoint; +var getResolver = function (base) { + var resolver = new resolver_1.Resolver(base); + return resolver.resolve.bind(resolver); +}; +exports.getResolver = getResolver; +var determineServerEndpoint = function (location) { + var endpoint = (0, exports.ensureSuffix)("//", "" + location.protocol) + location.host; + var path = (0, exports.ensurePrefix)("/", location.pathname); + if (path.length >= 1) { + var lastSegmentIndex = path.lastIndexOf("/"); + if (lastSegmentIndex >= 0) { + path = path.substring(0, lastSegmentIndex + 1); } - return this.rootDocument; - }; - Client.prototype.resolveUrlWithSpaceId = function (path, args) { - return this.resolve(path, this.getArgsWithSpaceId(args)); - }; - return Client; -}()); -exports.Client = Client; + } + endpoint = endpoint + path; + return endpoint; +}; +exports.determineServerEndpoint = determineServerEndpoint; +exports.ensurePrefix = (0, lodash_1.curry)(function (prefix, value) { return (!value.startsWith(prefix) ? "".concat(prefix).concat(value) : value); }); +exports.ensureSuffix = (0, lodash_1.curry)(function (suffix, value) { return (!value.endsWith(suffix) ? "".concat(value).concat(suffix) : value); }); +var typeSafeHasOwnProperty = function (target, key) { + return target.hasOwnProperty(key); +}; +exports.typeSafeHasOwnProperty = typeSafeHasOwnProperty; +var isPropertyDefinedAndNotNull = function (target, key) { + return (0, exports.typeSafeHasOwnProperty)(target, key) && target[key] !== null && target[key] !== undefined; +}; +exports.isPropertyDefinedAndNotNull = isPropertyDefinedAndNotNull; /***/ }), -/***/ 5966: +/***/ 21843: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AADCredentialType = void 0; +var AADCredentialType; +(function (AADCredentialType) { + AADCredentialType["ClientCredential"] = "ClientCredential"; + AADCredentialType["UserCredential"] = "UserCredential"; +})(AADCredentialType = exports.AADCredentialType || (exports.AADCredentialType = {})); +//# sourceMappingURL=aadCredentialType.js.map + +/***/ }), + +/***/ 88253: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=accountResource.js.map + +/***/ }), + +/***/ 35608: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=accountResourceLinks.js.map + +/***/ }), + +/***/ 34914: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AccountType = void 0; +var AccountType; +(function (AccountType) { + AccountType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; + AccountType["AzureServicePrincipal"] = "AzureServicePrincipal"; + AccountType["AzureSubscription"] = "AzureSubscription"; + AccountType["GoogleCloudAccount"] = "GoogleCloudAccount"; + AccountType["None"] = "None"; + AccountType["SshKeyPair"] = "SshKeyPair"; + AccountType["Token"] = "Token"; + AccountType["UsernamePassword"] = "UsernamePassword"; +})(AccountType = exports.AccountType || (exports.AccountType = {})); +//# sourceMappingURL=accountType.js.map + +/***/ }), + +/***/ 6687: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=accountUsageResource.js.map + +/***/ }), + +/***/ 7689: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ActionExecutionLocation = void 0; +var ActionExecutionLocation; +(function (ActionExecutionLocation) { + ActionExecutionLocation["AlwaysOnTarget"] = "AlwaysOnTarget"; + ActionExecutionLocation["AlwaysOnServer"] = "AlwaysOnServer"; + ActionExecutionLocation["TargetOrServer"] = "TargetOrServer"; +})(ActionExecutionLocation = exports.ActionExecutionLocation || (exports.ActionExecutionLocation = {})); +//# sourceMappingURL=actionExecutionLocation.js.map + +/***/ }), + +/***/ 9801: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ActionHandlerCategory = void 0; +var ActionHandlerCategory; +(function (ActionHandlerCategory) { + ActionHandlerCategory["Atlassian"] = "Atlassian"; + ActionHandlerCategory["Aws"] = "Aws"; + ActionHandlerCategory["Azure"] = "Azure"; + ActionHandlerCategory["BuiltInStep"] = "BuiltInStep"; + ActionHandlerCategory["Certificate"] = "Certificate"; + ActionHandlerCategory["Community"] = "Community"; + ActionHandlerCategory["CommunitySubCategory"] = "CommunitySubCategory"; + ActionHandlerCategory["Docker"] = "Docker"; + ActionHandlerCategory["GoogleCloud"] = "Google"; + ActionHandlerCategory["JavaAppServer"] = "JavaAppServer"; + ActionHandlerCategory["Kubernetes"] = "Kubernetes"; + ActionHandlerCategory["Other"] = "Other"; + ActionHandlerCategory["Package"] = "Package"; + ActionHandlerCategory["Script"] = "Script"; + ActionHandlerCategory["StepTemplate"] = "StepTemplate"; + ActionHandlerCategory["Terraform"] = "Terraform"; + ActionHandlerCategory["WindowsServer"] = "WindowsServer"; +})(ActionHandlerCategory = exports.ActionHandlerCategory || (exports.ActionHandlerCategory = {})); +//# sourceMappingURL=actionHandlerCategory.js.map + +/***/ }), + +/***/ 71517: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=actionInputs.js.map + +/***/ }), + +/***/ 6531: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=actionProperties.js.map + +/***/ }), + +/***/ 10136: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=actionTemplateCategoryResource.js.map + +/***/ }), + +/***/ 9947: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=actionTemplateParameterDisplaySettings.js.map + +/***/ }), + +/***/ 48998: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=actionTemplateParameterResource.js.map + +/***/ }), + +/***/ 47799: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.processConfiguration = void 0; -var environmentVariables_1 = __nccwpck_require__(48583); -function processConfiguration(configuration) { - var apiKey = process.env[environmentVariables_1.EnvironmentVariables.ApiKey] || ""; - var host = process.env[environmentVariables_1.EnvironmentVariables.Host] || ""; - var space = process.env[environmentVariables_1.EnvironmentVariables.Space] || ""; - if (!configuration) { - return { - apiKey: apiKey, - apiUri: host, - autoConnect: true, - space: space, - }; +exports.getFeedTypesForActionType = void 0; +var feedType_1 = __nccwpck_require__(30090); +function getFeedTypesForActionType(actionType) { + switch (actionType) { + case "Octopus.DockerRun": + return [feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry]; + case "Octopus.HelmChartUpgrade": + return [feedType_1.FeedType.Helm]; + case "Octopus.JavaArchive": + case "Octopus.TomcatDeploy": + case "Octopus.WildFlyDeploy": + return [feedType_1.FeedType.Nuget, feedType_1.FeedType.BuiltIn, feedType_1.FeedType.Maven]; + case "Octopus.TentaclePackage": + case "Octopus.TransferPackage": + return [ + feedType_1.FeedType.Nuget, + feedType_1.FeedType.BuiltIn, + feedType_1.FeedType.Maven, + feedType_1.FeedType.GitHub, + ]; } - return { - apiKey: !configuration.apiKey || configuration.apiKey.length === 0 ? apiKey : configuration.apiKey, - apiUri: !configuration.apiUri || configuration.apiUri.length === 0 ? host : configuration.apiUri, - autoConnect: !configuration.autoConnect ? true : configuration.autoConnect, - space: !configuration.space || configuration.space.length === 0 ? space : configuration.space, - }; + return []; } -exports.processConfiguration = processConfiguration; +exports.getFeedTypesForActionType = getFeedTypesForActionType; +//# sourceMappingURL=actionTemplateResource.js.map + +/***/ }), + +/***/ 34440: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=actionTemplateSearchResource.js.map + +/***/ }), + +/***/ 49241: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=actionTemplateUsageResource.js.map + +/***/ }), + +/***/ 53132: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ActionUpdateOutcome = void 0; +var ActionUpdateOutcome; +(function (ActionUpdateOutcome) { + ActionUpdateOutcome["DefaultParamterValueMissing"] = "DefaultParamterValueMissing"; + ActionUpdateOutcome["ManualMergeRequired"] = "ManualMergeRequired"; + ActionUpdateOutcome["RemovedPackageInUse"] = "RemovedPackageInUse"; + ActionUpdateOutcome["Success"] = "Success"; +})(ActionUpdateOutcome = exports.ActionUpdateOutcome || (exports.ActionUpdateOutcome = {})); +//# sourceMappingURL=actionUpdateOutcome.js.map + +/***/ }), + +/***/ 56543: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ActionUpdatePackageUsedBy = void 0; +var ActionUpdatePackageUsedBy; +(function (ActionUpdatePackageUsedBy) { + ActionUpdatePackageUsedBy["ChannelRule"] = "ChannelRule"; + ActionUpdatePackageUsedBy["ProjectReleaseCreationStrategy"] = "ProjectReleaseCreationStrategy"; + ActionUpdatePackageUsedBy["ProjectVersionStrategy"] = "ProjectVersionStrategy"; +})(ActionUpdatePackageUsedBy = exports.ActionUpdatePackageUsedBy || (exports.ActionUpdatePackageUsedBy = {})); +//# sourceMappingURL=actionUpdatePackageUsedBy.js.map /***/ }), -/***/ 92101: +/***/ 40407: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); - +//# sourceMappingURL=actionUpdateRemovedPackageUsage.js.map /***/ }), -/***/ 57948: +/***/ 99710: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); - +//# sourceMappingURL=actionUpdateResource.js.map /***/ }), -/***/ 16397: +/***/ 34926: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); - +//# sourceMappingURL=actionUpdateResultResource.js.map /***/ }), -/***/ 35758: +/***/ 30597: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); - +//# sourceMappingURL=actionsUpdateProcessResource.js.map /***/ }), -/***/ 45953: +/***/ 80778: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ClientSession = void 0; -var ClientSession = /** @class */ (function () { - function ClientSession(cache, isAuthenticated, endSession) { - var _this = this; - this.cache = cache; - this.isAuthenticated = isAuthenticated; - this.endSession = endSession; - this.end = function () { - _this.endSession(); - _this.cache.clearAll(); - }; - } - return ClientSession; -}()); -exports.ClientSession = ClientSession; - +//# sourceMappingURL=agentlessEndpointResource.js.map /***/ }), -/***/ 96050: -/***/ ((__unused_webpack_module, exports) => { +/***/ 94582: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -var Environment = /** @class */ (function () { - function Environment() { - } - Environment.isInDevelopmentMode = function () { - return !process.env.NODE_ENV || process.env.NODE_ENV !== "production"; +exports.NewAmazonWebServicesAccount = void 0; +var accountType_1 = __nccwpck_require__(34914); +function NewAmazonWebServicesAccount(name, accessKey, secretKey) { + return { + AccessKey: accessKey, + AccountType: accountType_1.AccountType.AmazonWebServicesAccount, + Name: name, + SecretKey: secretKey, }; - return Environment; -}()); -exports["default"] = Environment; - +} +exports.NewAmazonWebServicesAccount = NewAmazonWebServicesAccount; +//# sourceMappingURL=amazonWebServicesAccountResource.js.map /***/ }), -/***/ 48583: +/***/ 30939: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EnvironmentVariables = void 0; -exports.EnvironmentVariables = { - ApiKey: "OCTOPUS_API_KEY", - Host: "OCTOPUS_HOST", - Proxy: "OCTOPUS_PROXY", - ProxyPassword: "OCTOPUS_PROXY_PASSWORD", - ProxyUsername: "OCTOPUS_PROXY_USERNAME", - Space: "OCTOPUS_SPACE", -}; - +//# sourceMappingURL=apiKeyCreatedResource.js.map /***/ }), -/***/ 30661: +/***/ 18304: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); - +//# sourceMappingURL=apiKeyResource.js.map /***/ }), -/***/ 80586: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 58502: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(51542), exports); -__exportStar(__nccwpck_require__(63024), exports); -__exportStar(__nccwpck_require__(42399), exports); -__exportStar(__nccwpck_require__(5966), exports); -__exportStar(__nccwpck_require__(92101), exports); -__exportStar(__nccwpck_require__(57948), exports); -__exportStar(__nccwpck_require__(16397), exports); -__exportStar(__nccwpck_require__(35758), exports); -__exportStar(__nccwpck_require__(45953), exports); -__exportStar(__nccwpck_require__(96050), exports); -__exportStar(__nccwpck_require__(48583), exports); -__exportStar(__nccwpck_require__(30661), exports); -__exportStar(__nccwpck_require__(5924), exports); -__exportStar(__nccwpck_require__(9507), exports); -__exportStar(__nccwpck_require__(67895), exports); -__exportStar(__nccwpck_require__(89463), exports); -__exportStar(__nccwpck_require__(42583), exports); -__exportStar(__nccwpck_require__(15835), exports); -__exportStar(__nccwpck_require__(7946), exports); -__exportStar(__nccwpck_require__(4776), exports); -__exportStar(__nccwpck_require__(41266), exports); -__exportStar(__nccwpck_require__(94659), exports); -__exportStar(__nccwpck_require__(94203), exports); -__exportStar(__nccwpck_require__(69039), exports); -__exportStar(__nccwpck_require__(13497), exports); -__exportStar(__nccwpck_require__(66446), exports); -__exportStar(__nccwpck_require__(20009), exports); -__exportStar(__nccwpck_require__(81630), exports); -__exportStar(__nccwpck_require__(82773), exports); -__exportStar(__nccwpck_require__(91848), exports); -__exportStar(__nccwpck_require__(98936), exports); -__exportStar(__nccwpck_require__(27848), exports); -__exportStar(__nccwpck_require__(8183), exports); -__exportStar(__nccwpck_require__(65269), exports); -__exportStar(__nccwpck_require__(22999), exports); -__exportStar(__nccwpck_require__(4387), exports); -__exportStar(__nccwpck_require__(55459), exports); -__exportStar(__nccwpck_require__(56116), exports); -__exportStar(__nccwpck_require__(20037), exports); -__exportStar(__nccwpck_require__(18029), exports); -__exportStar(__nccwpck_require__(90977), exports); -__exportStar(__nccwpck_require__(15228), exports); -__exportStar(__nccwpck_require__(78681), exports); -__exportStar(__nccwpck_require__(64693), exports); -__exportStar(__nccwpck_require__(51916), exports); -__exportStar(__nccwpck_require__(56946), exports); -__exportStar(__nccwpck_require__(3522), exports); -__exportStar(__nccwpck_require__(154), exports); -__exportStar(__nccwpck_require__(53015), exports); -__exportStar(__nccwpck_require__(50197), exports); -__exportStar(__nccwpck_require__(1939), exports); -__exportStar(__nccwpck_require__(94772), exports); -__exportStar(__nccwpck_require__(80891), exports); -__exportStar(__nccwpck_require__(34819), exports); -__exportStar(__nccwpck_require__(53378), exports); -__exportStar(__nccwpck_require__(21797), exports); -__exportStar(__nccwpck_require__(97886), exports); -__exportStar(__nccwpck_require__(53127), exports); -// export * from "./repositories/projectContextRepository"; -__exportStar(__nccwpck_require__(38331), exports); -__exportStar(__nccwpck_require__(52058), exports); -__exportStar(__nccwpck_require__(91795), exports); -__exportStar(__nccwpck_require__(57502), exports); -__exportStar(__nccwpck_require__(7358), exports); -__exportStar(__nccwpck_require__(87252), exports); -__exportStar(__nccwpck_require__(11050), exports); -__exportStar(__nccwpck_require__(82404), exports); -__exportStar(__nccwpck_require__(18312), exports); -__exportStar(__nccwpck_require__(30242), exports); -__exportStar(__nccwpck_require__(73544), exports); -__exportStar(__nccwpck_require__(63767), exports); -__exportStar(__nccwpck_require__(18774), exports); -__exportStar(__nccwpck_require__(96489), exports); -__exportStar(__nccwpck_require__(84463), exports); -__exportStar(__nccwpck_require__(50924), exports); -__exportStar(__nccwpck_require__(7025), exports); -__exportStar(__nccwpck_require__(56836), exports); -__exportStar(__nccwpck_require__(94178), exports); -__exportStar(__nccwpck_require__(50450), exports); -__exportStar(__nccwpck_require__(53573), exports); -__exportStar(__nccwpck_require__(30986), exports); -__exportStar(__nccwpck_require__(66168), exports); -__exportStar(__nccwpck_require__(54198), exports); -__exportStar(__nccwpck_require__(19652), exports); -__exportStar(__nccwpck_require__(99284), exports); -__exportStar(__nccwpck_require__(67597), exports); -__exportStar(__nccwpck_require__(41025), exports); -__exportStar(__nccwpck_require__(27747), exports); -__exportStar(__nccwpck_require__(10895), exports); -__exportStar(__nccwpck_require__(74126), exports); -__exportStar(__nccwpck_require__(72887), exports); -__exportStar(__nccwpck_require__(50210), exports); -__exportStar(__nccwpck_require__(65737), exports); -__exportStar(__nccwpck_require__(91616), exports); -__exportStar(__nccwpck_require__(43399), exports); -__exportStar(__nccwpck_require__(871), exports); -__exportStar(__nccwpck_require__(15435), exports); -__exportStar(__nccwpck_require__(28043), exports); -__exportStar(__nccwpck_require__(82138), exports); -__exportStar(__nccwpck_require__(60232), exports); -__exportStar(__nccwpck_require__(445), exports); -__exportStar(__nccwpck_require__(31547), exports); -__exportStar(__nccwpck_require__(54663), exports); -__exportStar(__nccwpck_require__(47132), exports); +//# sourceMappingURL=artifactResource.js.map + +/***/ }), +/***/ 16089: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=authenticationError.js.map /***/ }), -/***/ 5924: +/***/ 38639: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AuthenticationProviderElement = void 0; +var AuthenticationProviderElement = (function () { + function AuthenticationProviderElement() { + this.CSSLinks = undefined; + this.FormsLoginEnabled = undefined; + this.IdentityType = undefined; + this.JavascriptLinks = undefined; + this.Links = undefined; + this.Name = undefined; + } + return AuthenticationProviderElement; +}()); +exports.AuthenticationProviderElement = AuthenticationProviderElement; +//# sourceMappingURL=authenticationProviderElement.js.map + +/***/ }), + +/***/ 72866: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=authenticationResource.js.map /***/ }), -/***/ 9507: +/***/ 64699: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -5388,870 +13632,407 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AccountRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var AccountRepository = /** @class */ (function (_super) { - __extends(AccountRepository, _super); - function AccountRepository(client) { - return _super.call(this, "Accounts", client) || this; +exports.AutoDeployActionResource = void 0; +var triggerActionResource_1 = __nccwpck_require__(59636); +var triggerActionType_1 = __nccwpck_require__(58574); +var AutoDeployActionResource = (function (_super) { + __extends(AutoDeployActionResource, _super); + function AutoDeployActionResource() { + var _this = _super.call(this) || this; + _this.ShouldRedeployWhenMachineHasBeenDeployedTo = undefined; + _this.ActionType = triggerActionType_1.TriggerActionType.AutoDeploy; + return _this; } - AccountRepository.prototype.getAccountUsages = function (account) { - return this.client.get(account.Links["Usages"]); - }; - AccountRepository.prototype.getFabricApplications = function (account) { - return this.client.get(account.Links["FabricApplications"]); - }; - AccountRepository.prototype.getIsolatedAzureEnvironments = function () { - return this.client.get(this.client.getLink("AzureEnvironments")); - }; - AccountRepository.prototype.getResourceGroups = function (account) { - return this.client.get(account.Links["ResourceGroups"]); - }; - AccountRepository.prototype.getStorageAccounts = function (account) { - return this.client.get(account.Links["StorageAccounts"]); - }; - AccountRepository.prototype.getWebSites = function (account) { - return this.client.get(account.Links["WebSites"]); - }; - AccountRepository.prototype.getWebSiteSlots = function (account, resourceGroupName, webSiteName) { - var args = { resourceGroupName: resourceGroupName, webSiteName: webSiteName }; - return this.client.get(account.Links["WebSiteSlots"], args); - }; - return AccountRepository; -}(basicRepository_1.BasicRepository)); -exports.AccountRepository = AccountRepository; + return AutoDeployActionResource; +}(triggerActionResource_1.TriggerActionResource)); +exports.AutoDeployActionResource = AutoDeployActionResource; +//# sourceMappingURL=autoDeployActionResource.js.map + +/***/ }), + +/***/ 39349: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=awsElasticContainerRegistryFeedResource.js.map /***/ }), -/***/ 67895: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 92669: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -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); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionTemplateRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ActionTemplateRepository = /** @class */ (function (_super) { - __extends(ActionTemplateRepository, _super); - function ActionTemplateRepository(client) { - return _super.call(this, "ActionTemplates", client) || this; - } - ActionTemplateRepository.prototype.categories = function () { - return this.client.get(this.client.getLink("ActionTemplatesCategories")); - }; - ActionTemplateRepository.prototype.getByCommunityTemplate = function (communityTemplate) { - var allArgs = __assign({}, { id: communityTemplate.Id }); - return this.client.get(communityTemplate.Links["InstalledTemplate"], allArgs); - }; - ActionTemplateRepository.prototype.getUsage = function (template) { - return this.client.get(template.Links["Usage"]); - }; - ActionTemplateRepository.prototype.getVersion = function (actionTemplate, version) { - return this.client.get(actionTemplate.Links["Versions"], { version: version }); - }; - ActionTemplateRepository.prototype.search = function (args) { - return this.client.get(this.client.getLink("ActionTemplatesSearch"), args); - }; - ActionTemplateRepository.prototype.updateActions = function (actionTemplate, actionsToUpdate, defaults, overrides) { - if (defaults === void 0) { defaults = {}; } - if (overrides === void 0) { overrides = {}; } - var resource = { - ActionsToUpdate: actionsToUpdate, - Overrides: overrides || {}, - DefaultPropertyValues: defaults || {}, - Version: actionTemplate.Version, - }; - return this.client.post(actionTemplate.Links["ActionsUpdate"], resource); +//# sourceMappingURL=azureEnvironment.js.map + +/***/ }), + +/***/ 27134: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NewAzureServicePrincipalAccount = void 0; +var accountType_1 = __nccwpck_require__(34914); +function NewAzureServicePrincipalAccount(name, subscriptionId, tenantId, applicationId, applicationPassword) { + return { + AccountType: accountType_1.AccountType.AzureServicePrincipal, + ClientId: applicationId, + Name: name, + Password: applicationPassword, + SubscriptionNumber: subscriptionId, + TenantId: tenantId, }; - return ActionTemplateRepository; -}(basicRepository_1.BasicRepository)); -exports.ActionTemplateRepository = ActionTemplateRepository; +} +exports.NewAzureServicePrincipalAccount = NewAzureServicePrincipalAccount; +//# sourceMappingURL=azureServicePrincipalAccountResource.js.map + +/***/ }), + +/***/ 66707: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=azureWebSite.js.map /***/ }), -/***/ 89463: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 27673: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ArtifactRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ArtifactRepository = /** @class */ (function (_super) { - __extends(ArtifactRepository, _super); - function ArtifactRepository(client) { - return _super.call(this, "Artifacts", client) || this; - } - return ArtifactRepository; -}(basicRepository_1.BasicRepository)); -exports.ArtifactRepository = ArtifactRepository; +//# sourceMappingURL=azureWebSiteSlot.js.map + +/***/ }), + +/***/ 60035: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=buildInformationResource.js.map + +/***/ }), + +/***/ 91173: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=builtInFeedLinks.js.map + +/***/ }), + +/***/ 42969: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=builtInFeedResource.js.map + +/***/ }), + +/***/ 33477: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=builtInFeedStatsResource.js.map + +/***/ }), + +/***/ 39021: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=certificateConfigurationResource.js.map + +/***/ }), + +/***/ 50699: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=certificateResource.js.map + +/***/ }), + +/***/ 94840: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=certificateUsageResource.js.map + +/***/ }), +/***/ 18754: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=channelOclResource.js.map + +/***/ }), + +/***/ 90097: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=channelProgressionResource.js.map /***/ }), -/***/ 42583: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 52739: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AuthenticationRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var AuthenticationRepository = /** @class */ (function (_super) { - __extends(AuthenticationRepository, _super); - function AuthenticationRepository(client) { - return _super.call(this, "Authentication", client) || this; - } - AuthenticationRepository.prototype.get = function () { - return this.client.get(this.client.getLink("Authentication")); - }; - AuthenticationRepository.prototype.wasLoginInitiated = function (encodedQueryString) { - return this.client.post(this.client.getLink("LoginInitiated"), { EncodedQueryString: encodedQueryString }); +exports.NewChannel = void 0; +function NewChannel(name, projectId) { + return { + Name: name, + ProjectId: projectId, }; - return AuthenticationRepository; -}(basicRepository_1.BasicRepository)); -exports.AuthenticationRepository = AuthenticationRepository; - +} +exports.NewChannel = NewChannel; +//# sourceMappingURL=channelResource.js.map /***/ }), -/***/ 30970: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 78766: +/***/ ((__unused_webpack_module, exports) => { "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); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BasicRepository = void 0; -var lodash_1 = __nccwpck_require__(90250); -// Repositories provide a helpful abstraction around the Octopus Deploy API -var BasicRepository = /** @class */ (function () { - function BasicRepository(collectionLinkName, client) { - var _this = this; - this.takeAll = 2147483647; - this.takeDefaultPageSize = 30; - this.notifySubscribersToDataModifications = function (resource) { - Object.keys(_this.subscribersToDataModifications).forEach(function (key) { return _this.subscribersToDataModifications[key](resource); }); - return resource; - }; - this.collectionLinkName = collectionLinkName; - this.client = client; - this.subscribersToDataModifications = {}; - } - BasicRepository.prototype.all = function (args) { - if (args !== undefined && args.ids instanceof Array && args.ids.length === 0) { - return new Promise(function (res) { - res([]); - }); - } - // http.sys has a max query string of about 16k chars. Our typical max id length is 50 chars - // so if we are doing requests by id and have more than 300, split into multiple requests - var maxIds = 300; - if (args !== undefined && args.ids instanceof Array && args.ids.length > maxIds) { - return this.batchRequestsById(args, maxIds); - } - var allArgs = this.extend(args || {}, { id: "all" }); - return this.client.get(this.client.getLink(this.collectionLinkName), allArgs); - }; - BasicRepository.prototype.allById = function (args) { - return this.all(args).then(function (result) { - return result.reduce(function (acc, resource) { - acc[resource.Id] = resource; - return acc; - }, {}); - }); - }; - BasicRepository.prototype.del = function (resource) { - var _this = this; - return this.client.del(resource.Links.Self).then(function (d) { return _this.notifySubscribersToDataModifications(resource); }); - }; - BasicRepository.prototype.create = function (resource, args) { - var _this = this; - return this.client - .create(this.client.getLink(this.collectionLinkName), resource, args) - .then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - }; - BasicRepository.prototype.get = function (id, args) { - var allArgs = this.extend(args || {}, { id: id }); - return this.client.get(this.client.getLink(this.collectionLinkName), allArgs); - }; - BasicRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink(this.collectionLinkName), args); - }; - BasicRepository.prototype.modify = function (resource, args) { - var _this = this; - return this.client.update(resource.Links.Self, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - }; - BasicRepository.prototype.save = function (resource) { - if (isNewResource(resource)) { - return this.create(resource); - } - else { - return this.modify(resource); - } - function isTruthy(value) { - return !!value; - } - function isNewResource(resource) { - return !("Id" in resource && isTruthy(resource.Id) && isTruthy(resource.Links)); - } - }; - BasicRepository.prototype.subscribeToDataModifications = function (key, callback) { - this.subscribersToDataModifications[key] = callback; - }; - BasicRepository.prototype.unsubscribeFromDataModifications = function (key) { - delete this.subscribersToDataModifications[key]; - }; - BasicRepository.prototype.extend = function (arg1, arg2) { - return __assign(__assign({}, arg1), arg2); - }; - BasicRepository.prototype.batchRequestsById = function (args, batchSize) { - var _this = this; - var idArrays = (0, lodash_1.chunk)(args.ids, batchSize); - var promises = idArrays.map(function (ids) { - var newArgs = __assign(__assign({}, args), { ids: ids, id: "all" }); - return _this.client.get(_this.client.getLink(_this.collectionLinkName), newArgs); - }); - return Promise.all(promises).then(function (result) { return (0, lodash_1.flatten)(result); }); - }; - return BasicRepository; -}()); -exports.BasicRepository = BasicRepository; - +//# sourceMappingURL=channelVersionRuleResource.js.map /***/ }), -/***/ 15835: +/***/ 21303: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BranchesRepository = void 0; -var BranchesRepository = /** @class */ (function () { - function BranchesRepository(client) { - this.client = client; - this.client = client; - } - BranchesRepository.prototype.getTemplate = function (branch, channelId) { - return this.client.get(branch.Links["ReleaseTemplate"], { channel: channelId }); - }; - return BranchesRepository; -}()); -exports.BranchesRepository = BranchesRepository; - +//# sourceMappingURL=commitCommand.js.map /***/ }), -/***/ 7946: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 3712: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BuildInformationRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var BuildInformationRepository = /** @class */ (function (_super) { - __extends(BuildInformationRepository, _super); - function BuildInformationRepository(client) { - return _super.call(this, "BuildInformation", client) || this; - } - BuildInformationRepository.prototype.deleteMany = function (ids) { - return this.client.del(this.client.getLink("BuildInformationBulk"), null, { ids: ids }); - }; - return BuildInformationRepository; -}(basicRepository_1.BasicRepository)); -exports.BuildInformationRepository = BuildInformationRepository; - +//# sourceMappingURL=commitDetail.js.map /***/ }), -/***/ 4776: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 27734: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CertificateConfigurationRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var CertificateConfigurationRepository = /** @class */ (function (_super) { - __extends(CertificateConfigurationRepository, _super); - function CertificateConfigurationRepository(client) { - return _super.call(this, "CertificateConfiguration", client) || this; - } - CertificateConfigurationRepository.prototype.archive = function (certificate) { - return this.client.post(certificate.Links["Archive"]); - }; - CertificateConfigurationRepository.prototype.export = function (certificate, exportOptions) { - return this.client.get(certificate.Links["Export"], exportOptions); - }; - CertificateConfigurationRepository.prototype.global = function () { - return this.get("certificate-global"); - }; - CertificateConfigurationRepository.prototype.replace = function (certificate, newCertificateData, newPassword) { - return this.client.post(certificate.Links["Replace"], { - certificateData: newCertificateData, - password: newPassword, - }); - }; - CertificateConfigurationRepository.prototype.usage = function (certificate) { - return this.client.get(certificate.Links["Usages"]); - }; - CertificateConfigurationRepository.prototype.unarchive = function (certificate) { - return this.client.post(certificate.Links["Unarchive"]); - }; - return CertificateConfigurationRepository; -}(basicRepository_1.BasicRepository)); -exports.CertificateConfigurationRepository = CertificateConfigurationRepository; - +//# sourceMappingURL=commonTriggerResource.js.map /***/ }), -/***/ 41266: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 19170: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CertificateRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var SelfSignedEndpoint = "/generate"; -var CertificateRepository = /** @class */ (function (_super) { - __extends(CertificateRepository, _super); - function CertificateRepository(client) { - return _super.call(this, "Certificates", client) || this; - } - CertificateRepository.prototype.createSelfSigned = function (resource, args) { - var _this = this; - return this.client.create(this.client.getLink("Certificates") + SelfSignedEndpoint, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - }; - CertificateRepository.prototype.listForTenant = function (tenantId) { - return __awaiter(this, void 0, void 0, function () { - var certificates; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.list({ tenant: tenantId, take: this.takeAll })]; - case 1: - certificates = (_a.sent()).Items; - return [2 /*return*/, certificates]; - } - }); - }); - }; - CertificateRepository.prototype.names = function (projectId, projectEnvironmentsFilter) { - return this.client.get(this.client.getLink("VariableNames"), { - project: projectId, - projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, - }); - }; - CertificateRepository.prototype.saveSelfSigned = function (resource) { - if (isExistingResource(resource)) { - return this.modify(resource); - } - else { - return this.createSelfSigned(resource); - } - function isExistingResource(r) { - return !!r.Links && !!r.Id; - } - }; - return CertificateRepository; -}(basicRepository_1.BasicRepository)); -exports.CertificateRepository = CertificateRepository; - +exports.CommunicationStyle = void 0; +var CommunicationStyle; +(function (CommunicationStyle) { + CommunicationStyle["AzureCloudService"] = "AzureCloudService"; + CommunicationStyle["AzureServiceFabricCluster"] = "AzureServiceFabricCluster"; + CommunicationStyle["AzureWebApp"] = "AzureWebApp"; + CommunicationStyle["Kubernetes"] = "Kubernetes"; + CommunicationStyle["None"] = "None"; + CommunicationStyle["OfflineDrop"] = "OfflineDrop"; + CommunicationStyle["Ssh"] = "Ssh"; + CommunicationStyle["StepPackage"] = "StepPackage"; + CommunicationStyle["TentacleActive"] = "TentacleActive"; + CommunicationStyle["TentaclePassive"] = "TentaclePassive"; +})(CommunicationStyle = exports.CommunicationStyle || (exports.CommunicationStyle = {})); +//# sourceMappingURL=communicationStyle.js.map /***/ }), -/***/ 94659: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 99930: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ChannelRepository = void 0; -var projectScopedRepository_1 = __nccwpck_require__(91795); -var ChannelRepository = /** @class */ (function (_super) { - __extends(ChannelRepository, _super); - function ChannelRepository(projectRepository, client) { - return _super.call(this, projectRepository, "Channels", client) || this; - } - ChannelRepository.prototype.find = function (nameOrId) { - return __awaiter(this, void 0, void 0, function () { - var _a, channels; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (nameOrId.length === 0) - return [2 /*return*/]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.get(nameOrId)]; - case 2: return [2 /*return*/, _b.sent()]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: return [4 /*yield*/, this.list({ - partialName: nameOrId, - })]; - case 5: - channels = _b.sent(); - return [2 /*return*/, channels.Items.find(function (e) { return e.Name.localeCompare(nameOrId, undefined, { sensitivity: "base" }) === 0; })]; - } - }); - }); - }; - ChannelRepository.prototype.ruleTest = function (searchOptions) { - return this.client.post(this.client.getLink("VersionRuleTest"), searchOptions); - }; - ChannelRepository.prototype.getReleases = function (channel, options) { - return this.client.get(channel.Links["Releases"], options); - }; - ChannelRepository.prototype.getOcl = function (channel) { - return this.client.get(channel.Links["RawOcl"]); - }; - ChannelRepository.prototype.modifyOcl = function (channel, command) { - return this.client.update(channel.Links["RawOcl"], command); - }; - ChannelRepository.prototype.modify = function (channel, args) { - var payload = channel; - this.addCommitMessage(payload, args); - if (payload !== undefined) { - return this.client.update(channel.Links.Self, payload); - } - else { - return _super.prototype.modify.call(this, channel, args); - } - }; - ChannelRepository.prototype.createForProject = function (projectResource, channel, args) { - var _this = this; - var payload = channel; - this.addCommitMessage(payload, args); - if (payload !== undefined) { - var link = projectResource.Links[this.collectionLinkName]; - return this.client.create(link, payload, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - } - else { - return _super.prototype.createForProject.call(this, projectResource, channel, args); - } - }; - ChannelRepository.prototype.addCommitMessage = function (command, args) { - if (args !== undefined && "gitRef" in args && "commitMessage" in args) { - command.ChangeDescription = args["commitMessage"]; - } - }; - return ChannelRepository; -}(projectScopedRepository_1.ProjectScopedRepository)); -exports.ChannelRepository = ChannelRepository; +//# sourceMappingURL=communityActionTemplateResource.js.map + +/***/ }), + +/***/ 42546: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ControlType = void 0; +var ControlType; +(function (ControlType) { + ControlType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; + ControlType["AzureAccount"] = "AzureAccount"; + ControlType["Certificate"] = "Certificate"; + ControlType["Checkbox"] = "Checkbox"; + ControlType["Custom"] = "Custom"; + ControlType["GoogleCloudAccount"] = "GoogleCloudAccount"; + ControlType["MultiLineText"] = "MultiLineText"; + ControlType["Package"] = "Package"; + ControlType["Select"] = "Select"; + ControlType["Sensitive"] = "Sensitive"; + ControlType["SingleLineText"] = "SingleLineText"; + ControlType["StepName"] = "StepName"; + ControlType["WorkerPool"] = "WorkerPool"; +})(ControlType = exports.ControlType || (exports.ControlType = {})); +//# sourceMappingURL=controlType.js.map /***/ }), -/***/ 94203: +/***/ 83382: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CloudTemplateRepository = void 0; -var CloudTemplateRepository = /** @class */ (function () { - function CloudTemplateRepository(client) { - this.client = client; - } - CloudTemplateRepository.prototype.getMetadata = function (templateBody, id) { - var templateResource = { template: encodeURI(templateBody) }; - return this.client.post(this.client.getLink("CloudTemplate"), templateResource, { id: id.toString() }); - }; - return CloudTemplateRepository; -}()); -exports.CloudTemplateRepository = CloudTemplateRepository; - +//# sourceMappingURL=convertProjectToVersionControlledCommand.js.map /***/ }), -/***/ 69039: -/***/ (function(__unused_webpack_module, exports) { +/***/ 20006: +/***/ ((__unused_webpack_module, exports) => { "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); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CommunityActionTemplateRepository = void 0; -var CommunityActionTemplateRepository = /** @class */ (function () { - function CommunityActionTemplateRepository(client) { - this.client = client; - } - CommunityActionTemplateRepository.prototype.get = function (id) { - var allArgs = __assign({}, { id: id }); - return this.client.get(this.client.getLink("CommunityActionTemplates"), allArgs); - }; - CommunityActionTemplateRepository.prototype.install = function (communityActionTemplate) { - return this.client.post(communityActionTemplate.Links["Installation"]); - }; - CommunityActionTemplateRepository.prototype.updateInstallation = function (communityActionTemplate) { - return this.client.put(communityActionTemplate.Links["Installation"]); - }; - return CommunityActionTemplateRepository; -}()); -exports.CommunityActionTemplateRepository = CommunityActionTemplateRepository; - +//# sourceMappingURL=dashboardConfigurationResource.js.map /***/ }), -/***/ 13497: +/***/ 26289: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConfigurationRepository = void 0; -var ConfigurationRepository = /** @class */ (function () { - function ConfigurationRepository(configurationLinkName, client) { - this.configurationLinkName = configurationLinkName; - this.client = client; - } - ConfigurationRepository.prototype.get = function () { - return this.client.get(this.client.getLink(this.configurationLinkName)); - }; - ConfigurationRepository.prototype.modify = function (resource) { - return this.client.update(resource.Links["Self"], resource); - }; - return ConfigurationRepository; -}()); -exports.ConfigurationRepository = ConfigurationRepository; +//# sourceMappingURL=dashboardEnvironmentResource.js.map +/***/ }), + +/***/ 64543: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=dashboardItemResource.js.map /***/ }), -/***/ 66446: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 88640: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DashboardConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var DashboardConfigurationRepository = /** @class */ (function (_super) { - __extends(DashboardConfigurationRepository, _super); - function DashboardConfigurationRepository(client) { - return _super.call(this, "DashboardConfiguration", client) || this; - } - return DashboardConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.DashboardConfigurationRepository = DashboardConfigurationRepository; +//# sourceMappingURL=dashboardProjectGroupResource.js.map + +/***/ }), + +/***/ 21706: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=dashboardProjectResource.js.map /***/ }), -/***/ 20009: +/***/ 65120: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DashboardItemsOptions = exports.DashboardRepository = void 0; -var DashboardRepository = /** @class */ (function () { - function DashboardRepository(client) { - this.client = client; - } - DashboardRepository.prototype.getDeploymentsCountedByWeek = function (projectIds) { - return this.client.get(this.client.getLink("Reporting/DeploymentsCountedByWeek"), { projectIds: projectIds.join(",") }); - }; - DashboardRepository.prototype.getDashboard = function (dashboardFilter) { - return this.client.get(this.client.getLink("Dashboard"), dashboardFilter); - }; - DashboardRepository.prototype.getDynamicDashboard = function (projects, environments, dashboardItemsOptions) { - if (dashboardItemsOptions === void 0) { dashboardItemsOptions = DashboardItemsOptions.IncludeCurrentDeploymentOnly; } - return this.client.get(this.client.getLink("DashboardDynamic"), { - projects: projects, - environments: environments, - includePrevious: dashboardItemsOptions === DashboardItemsOptions.IncludeCurrentAndPreviousSuccessfulDeployment, - }); - }; - return DashboardRepository; -}()); -exports.DashboardRepository = DashboardRepository; -var DashboardItemsOptions; -(function (DashboardItemsOptions) { - DashboardItemsOptions[DashboardItemsOptions["IncludeCurrentDeploymentOnly"] = 0] = "IncludeCurrentDeploymentOnly"; - DashboardItemsOptions[DashboardItemsOptions["IncludeCurrentAndPreviousSuccessfulDeployment"] = 1] = "IncludeCurrentAndPreviousSuccessfulDeployment"; -})(DashboardItemsOptions = exports.DashboardItemsOptions || (exports.DashboardItemsOptions = {})); +//# sourceMappingURL=dashboardResource.js.map + +/***/ }), +/***/ 60599: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=dashboardTenantResource.js.map /***/ }), -/***/ 81630: +/***/ 61676: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefectRepository = void 0; -var DefectRepository = /** @class */ (function () { - function DefectRepository(client) { - this.client = client; - } - DefectRepository.prototype.all = function (release) { - return this.client.get(release.Links["Defects"]); - }; - DefectRepository.prototype.report = function (release, description) { - return this.client.post(release.Links["ReportDefect"], { Description: description }); - }; - DefectRepository.prototype.resolve = function (release) { - return this.client.post(release.Links["ResolveDefect"]); - }; - return DefectRepository; -}()); -exports.DefectRepository = DefectRepository; +//# sourceMappingURL=defectResource.js.map + +/***/ }), + +/***/ 71615: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DefectStatus = void 0; +var DefectStatus; +(function (DefectStatus) { + DefectStatus["Resolved"] = "Resolved"; + DefectStatus["Unresolved"] = "Unresolved"; +})(DefectStatus = exports.DefectStatus || (exports.DefectStatus = {})); +//# sourceMappingURL=defectStatus.js.map /***/ }), -/***/ 82773: +/***/ 26994: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { @@ -6263,1821 +14044,1184 @@ var __assign = (this && this.__assign) || function () { }; return __assign.apply(this, arguments); }; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (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; +}; +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)); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeploymentProcessRepository = void 0; -var projectScopedRepository_1 = __nccwpck_require__(91795); -var DeploymentProcessRepository = /** @class */ (function (_super) { - __extends(DeploymentProcessRepository, _super); - function DeploymentProcessRepository(projectRepository, client) { - var _this = _super.call(this, projectRepository, "DeploymentProcesses", client) || this; - _this.resourceLink = "DeploymentProcess"; - _this.collectionLink = "DeploymentProcesses"; - return _this; +exports.InitialisePrimaryPackageReference = exports.SetPrimaryPackageReference = exports.SetNamedPackageReference = exports.GetNamedPackageReferences = exports.IsNamedPackageReference = exports.GetPrimaryPackageReference = exports.HasManualInterventionResponsibleTeams = exports.PackageReferenceNamesMatch = exports.RemovePrimaryPackageReference = exports.IsPrimaryPackageReference = exports.IsDeployReleaseAction = void 0; +var _ = __importStar(__nccwpck_require__(90250)); +var feedType_1 = __nccwpck_require__(30090); +var packageAcquisitionLocation_1 = __nccwpck_require__(37648); +var packageReference_1 = __nccwpck_require__(66933); +function parseCSV(val) { + if (!val || val === "") { + return []; } - DeploymentProcessRepository.prototype.get = function (id, gitRef) { - return _super.prototype.get.call(this, id, { gitRef: gitRef }); - }; - DeploymentProcessRepository.prototype.getForRelease = function (release) { - return this.client.get(this.client.getLink(this.collectionLink), { id: release.ProjectDeploymentProcessSnapshotId }); - }; - DeploymentProcessRepository.prototype.getTemplate = function (deploymentProcess, channel, releaseId) { - return this.client.get(deploymentProcess.Links["Template"], { channel: channel === null || channel === void 0 ? void 0 : channel.Id, releaseId: releaseId }); - }; - DeploymentProcessRepository.prototype.modify = function (deploymentProcess) { - return this.client.update(deploymentProcess.Links.Self, deploymentProcess); - }; - DeploymentProcessRepository.prototype.validate = function (deploymentProcess) { - return this.client.post(deploymentProcess.Links["Validation"], __assign({}, deploymentProcess)); - }; - DeploymentProcessRepository.prototype.getOcl = function (deploymentProcess) { - return this.client.get(deploymentProcess.Links["RawOcl"]); - }; - DeploymentProcessRepository.prototype.modifyOcl = function (deploymentProcess, command) { - return this.client.update(deploymentProcess.Links["RawOcl"], command); - }; - return DeploymentProcessRepository; -}(projectScopedRepository_1.ProjectScopedRepository)); -exports.DeploymentProcessRepository = DeploymentProcessRepository; + return val.split(","); +} +function IsDeployReleaseAction(action) { + return !!action.Properties["Octopus.Action.DeployRelease.ProjectId"]; +} +exports.IsDeployReleaseAction = IsDeployReleaseAction; +function IsPrimaryPackageReference(pkg) { + return !pkg.Name; +} +exports.IsPrimaryPackageReference = IsPrimaryPackageReference; +function RemovePrimaryPackageReference(packages) { + return _.filter(packages, function (pkg) { return !IsPrimaryPackageReference(pkg); }); +} +exports.RemovePrimaryPackageReference = RemovePrimaryPackageReference; +function PackageReferenceNamesMatch(nameA, nameB) { + if (!nameA) { + return !nameB; + } + return nameA === nameB; +} +exports.PackageReferenceNamesMatch = PackageReferenceNamesMatch; +function HasManualInterventionResponsibleTeams(action) { + return _.some(parseCSV(action.Properties["Octopus.Action.Manual.ResponsibleTeamIds"])); +} +exports.HasManualInterventionResponsibleTeams = HasManualInterventionResponsibleTeams; +function GetPrimaryPackageReference(packages) { + return packages === null || packages === void 0 ? void 0 : packages.find(function (pkg) { return IsPrimaryPackageReference(pkg); }); +} +exports.GetPrimaryPackageReference = GetPrimaryPackageReference; +function IsNamedPackageReference(pkg) { + return !!pkg.Name; +} +exports.IsNamedPackageReference = IsNamedPackageReference; +function GetNamedPackageReferences(packages) { + return RemovePrimaryPackageReference(packages); +} +exports.GetNamedPackageReferences = GetNamedPackageReferences; +function SetNamedPackageReference(name, updated, packages) { + return _.map(packages, function (pkg) { + if (!PackageReferenceNamesMatch(name, pkg.Name)) { + return pkg; + } + return __assign(__assign({}, pkg), updated); + }); +} +exports.SetNamedPackageReference = SetNamedPackageReference; +function SetPrimaryPackageReference(updated, packages) { + return _.map(packages, function (pkg) { + if (!IsPrimaryPackageReference(pkg)) { + return pkg; + } + return __assign(__assign({}, pkg), updated); + }); +} +exports.SetPrimaryPackageReference = SetPrimaryPackageReference; +function InitialisePrimaryPackageReference(packages, feeds, itemsKeyedBy) { + var primaryPackage = GetPrimaryPackageReference(packages); + if (primaryPackage) { + if (!primaryPackage.Properties.SelectionMode) { + primaryPackage.Properties.SelectionMode = packageReference_1.PackageSelectionMode.Immediate; + } + return __spreadArray([], packages, true); + } + var packagesWithoutDefault = RemovePrimaryPackageReference(packages); + var builtInFeed = feeds.find(function (f) { return f.FeedType === feedType_1.FeedType.BuiltIn; }); + var builtInFeedIdOrName = builtInFeed && builtInFeed[itemsKeyedBy]; + return __spreadArray([ + { + Id: null, + PackageId: null, + FeedId: builtInFeedIdOrName, + AcquisitionLocation: packageAcquisitionLocation_1.PackageAcquisitionLocation.Server, + Properties: { + SelectionMode: packageReference_1.PackageSelectionMode.Immediate, + }, + } + ], packagesWithoutDefault, true); +} +exports.InitialisePrimaryPackageReference = InitialisePrimaryPackageReference; +//# sourceMappingURL=deploymentActionResource.js.map + +/***/ }), + +/***/ 40633: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isDeploymentPreviewResource = void 0; +var utils_1 = __nccwpck_require__(12765); +function isDeploymentPreviewResource(resource) { + var converted = resource; + return (converted.Changes !== undefined && + (0, utils_1.typeSafeHasOwnProperty)(converted, "Changes")); +} +exports.isDeploymentPreviewResource = isDeploymentPreviewResource; +//# sourceMappingURL=deploymentPreviewResource.js.map /***/ }), -/***/ 91848: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 157: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeploymentRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var DeploymentRepository = /** @class */ (function (_super) { - __extends(DeploymentRepository, _super); - function DeploymentRepository(client) { - return _super.call(this, "Deployments", client) || this; +exports.processResourcePermission = exports.isRunbookProcessResource = exports.isDeploymentProcessResource = void 0; +var permission_1 = __nccwpck_require__(49346); +var utils_1 = __nccwpck_require__(12765); +function isDeploymentProcessResource(resource) { + if (resource === null || resource === undefined) { + return false; } - return DeploymentRepository; -}(basicRepository_1.BasicRepository)); -exports.DeploymentRepository = DeploymentRepository; + var converted = resource; + return (!isRunbookProcessResource(resource) && + converted.Version !== undefined && + (0, utils_1.typeSafeHasOwnProperty)(converted, "Version")); +} +exports.isDeploymentProcessResource = isDeploymentProcessResource; +function isRunbookProcessResource(resource) { + if (resource === null || resource === undefined) { + return false; + } + var converted = resource; + return (converted.RunbookId !== undefined && + (0, utils_1.typeSafeHasOwnProperty)(converted, "RunbookId")); +} +exports.isRunbookProcessResource = isRunbookProcessResource; +function processResourcePermission(resource) { + var isRunbook = isRunbookProcessResource(resource); + return isRunbook ? permission_1.Permission.RunbookEdit : permission_1.Permission.ProcessEdit; +} +exports.processResourcePermission = processResourcePermission; +//# sourceMappingURL=deploymentProcessResource.js.map + +/***/ }), + +/***/ 71976: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=deploymentResource.js.map + +/***/ }), + +/***/ 81741: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.GuidedFailureMode = void 0; +var GuidedFailureMode; +(function (GuidedFailureMode) { + GuidedFailureMode["EnvironmentDefault"] = "EnvironmentDefault"; + GuidedFailureMode["Off"] = "Off"; + GuidedFailureMode["On"] = "On"; +})(GuidedFailureMode = exports.GuidedFailureMode || (exports.GuidedFailureMode = {})); +//# sourceMappingURL=deploymentSettingsResource.js.map + +/***/ }), + +/***/ 10322: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageRequirement = exports.RunCondition = exports.StartTrigger = void 0; +var StartTrigger; +(function (StartTrigger) { + StartTrigger["StartWithPrevious"] = "StartWithPrevious"; + StartTrigger["StartAfterPrevious"] = "StartAfterPrevious"; +})(StartTrigger = exports.StartTrigger || (exports.StartTrigger = {})); +var RunCondition; +(function (RunCondition) { + RunCondition["Success"] = "Success"; + RunCondition["Failure"] = "Failure"; + RunCondition["Always"] = "Always"; + RunCondition["Variable"] = "Variable"; +})(RunCondition = exports.RunCondition || (exports.RunCondition = {})); +var PackageRequirement; +(function (PackageRequirement) { + PackageRequirement["LetOctopusDecide"] = "LetOctopusDecide"; + PackageRequirement["BeforePackageAcquisition"] = "BeforePackageAcquisition"; + PackageRequirement["AfterPackageAcquisition"] = "AfterPackageAcquisition"; +})(PackageRequirement = exports.PackageRequirement || (exports.PackageRequirement = {})); +//# sourceMappingURL=deploymentStepResource.js.map + +/***/ }), + +/***/ 9042: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isDeploymentTarget = exports.NewDeploymentTarget = void 0; +var machineResource_1 = __nccwpck_require__(82705); +function NewDeploymentTarget(name, endpoint, environments, roles, tenantedDeploymentParticipation) { + return { + IsDisabled: false, + IsInProcess: false, + Endpoint: endpoint, + EnvironmentIds: environments.map(function (e) { return e.Id; }), + HasLatestCalamari: false, + HealthStatus: machineResource_1.MachineModelHealthStatus.Unknown, + Name: name, + MachinePolicyId: "", + Roles: roles, + TenantedDeploymentParticipation: tenantedDeploymentParticipation, + TenantIds: [], + TenantTags: [], + }; +} +exports.NewDeploymentTarget = NewDeploymentTarget; +function isDeploymentTarget(machine) { + return machine.EnvironmentIds !== undefined; +} +exports.isDeploymentTarget = isDeploymentTarget; +//# sourceMappingURL=deploymentTargetResource.js.map /***/ }), -/***/ 98936: +/***/ 95369: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeploymentSettingsRepository = void 0; -var DeploymentSettingsRepository = /** @class */ (function () { - function DeploymentSettingsRepository(client, project, branch) { - this.client = client; - this.project = project; - this.branch = branch; - this.resourceLink = "DeploymentSettings"; - this.client = client; - } - DeploymentSettingsRepository.prototype.get = function () { - if (this.project.IsVersionControlled && this.branch !== undefined) { - return this.client.get(this.branch.Links[this.resourceLink]); - } - return this.client.get(this.project.Links[this.resourceLink]); - }; - DeploymentSettingsRepository.prototype.getOcl = function (deploymentSettings) { - return this.client.get(deploymentSettings.Links["RawOcl"]); - }; - DeploymentSettingsRepository.prototype.modify = function (deploymentSettings) { - return this.client.update(deploymentSettings.Links.Self, deploymentSettings); - }; - DeploymentSettingsRepository.prototype.modifyOcl = function (deploymentSettings, command) { - return this.client.update(deploymentSettings.Links["RawOcl"], command); - }; - return DeploymentSettingsRepository; -}()); -exports.DeploymentSettingsRepository = DeploymentSettingsRepository; - +exports.DeploymentTargetTaskType = void 0; +var DeploymentTargetTaskType; +(function (DeploymentTargetTaskType) { + DeploymentTargetTaskType["Deployment"] = "Deployment"; + DeploymentTargetTaskType["RunbookRun"] = "RunbookRun"; +})(DeploymentTargetTaskType = exports.DeploymentTargetTaskType || (exports.DeploymentTargetTaskType = {})); +//# sourceMappingURL=deploymentTargetTaskType.js.map /***/ }), -/***/ 27848: +/***/ 48798: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DynamicExtensionRepository = void 0; -var DynamicExtensionRepository = /** @class */ (function () { - function DynamicExtensionRepository(client) { - this.client = client; - } - DynamicExtensionRepository.prototype.getFeaturesMetadata = function () { - return this.client.get(this.client.getLink("DynamicExtensionsFeaturesMetadata")); - }; - DynamicExtensionRepository.prototype.getFeaturesValues = function () { - return this.client.get(this.client.getLink("DynamicExtensionsFeaturesValues")); - }; - DynamicExtensionRepository.prototype.getScripts = function () { - return this.client.get(this.client.getLink("DynamicExtensionsScripts")); - }; - DynamicExtensionRepository.prototype.putFeaturesValues = function (values) { - return this.client.put(this.client.getLink("DynamicExtensionsFeaturesValues"), values); - }; - return DynamicExtensionRepository; -}()); -exports.DynamicExtensionRepository = DynamicExtensionRepository; - +//# sourceMappingURL=deploymentTemplateResource.js.map /***/ }), -/***/ 8183: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 67788: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EnvironmentRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var EnvironmentRepository = /** @class */ (function (_super) { - __extends(EnvironmentRepository, _super); - function EnvironmentRepository(client) { - return _super.call(this, "Environments", client) || this; - } - EnvironmentRepository.prototype.find = function (namesOrIds) { - return __awaiter(this, void 0, void 0, function () { - var environments, matchingEnvironments, _a, _loop_1, this_1, _i, namesOrIds_1, name_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (namesOrIds.length === 0) - return [2 /*return*/, []]; - environments = []; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.list({ - ids: namesOrIds, - })]; - case 2: - matchingEnvironments = _b.sent(); - environments.push.apply(environments, matchingEnvironments.Items); - return [3 /*break*/, 4]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: - _loop_1 = function (name_1) { - var matchingEnvironments; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, this_1.list({ - name: name_1, - })]; - case 1: - matchingEnvironments = _c.sent(); - environments.push.apply(environments, matchingEnvironments.Items.filter(function (e) { return e.Name.localeCompare(name_1, undefined, { sensitivity: 'base' }) === 0; })); - return [2 /*return*/]; - } - }); - }; - this_1 = this; - _i = 0, namesOrIds_1 = namesOrIds; - _b.label = 5; - case 5: - if (!(_i < namesOrIds_1.length)) return [3 /*break*/, 8]; - name_1 = namesOrIds_1[_i]; - return [5 /*yield**/, _loop_1(name_1)]; - case 6: - _b.sent(); - _b.label = 7; - case 7: - _i++; - return [3 /*break*/, 5]; - case 8: return [2 /*return*/, environments]; - } - }); - }); - }; - EnvironmentRepository.prototype.getMetadata = function (environment) { - return this.client.get(environment.Links["Metadata"], {}); - }; - EnvironmentRepository.prototype.sort = function (order) { - return this.client.put(this.client.getLink("EnvironmentSortOrder"), order); - }; - EnvironmentRepository.prototype.summary = function (args) { - return this.client.get(this.client.getLink("EnvironmentsSummary"), args); - }; - EnvironmentRepository.prototype.machines = function (environment, args) { - return this.client.get(environment.Links["Machines"], args); - }; - EnvironmentRepository.prototype.variablesScopedOnlyToThisEnvironment = function (environment) { - return this.client.get(environment.Links["SinglyScopedVariableDetails"]); - }; - return EnvironmentRepository; -}(basicRepository_1.BasicRepository)); -exports.EnvironmentRepository = EnvironmentRepository; - +//# sourceMappingURL=deploymentTemplateStep.js.map /***/ }), -/***/ 65269: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 69297: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var EventRepository = /** @class */ (function (_super) { - __extends(EventRepository, _super); - function EventRepository(client) { - return _super.call(this, "Events", client) || this; - } - EventRepository.prototype.categories = function (options) { - return this.client.get(this.client.getLink("EventCategories"), options); - }; - EventRepository.prototype.groups = function (options) { - return this.client.get(this.client.getLink("EventGroups"), options); - }; - EventRepository.prototype.documentTypes = function (options) { - return this.client.get(this.client.getLink("EventDocumentTypes"), options); - }; - EventRepository.prototype.eventAgents = function () { - return this.client.get(this.client.getLink("EventAgents")); - }; - return EventRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.EventRepository = EventRepository; - +//# sourceMappingURL=documentSummary.js.map /***/ }), -/***/ 22999: +/***/ 33162: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExternalSecurityGroupProviderRepository = void 0; -var ExternalSecurityGroupProviderRepository = /** @class */ (function () { - function ExternalSecurityGroupProviderRepository(client) { - this.client = client; - } - ExternalSecurityGroupProviderRepository.prototype.all = function () { - return this.client.get(this.client.getLink("ExternalSecurityGroupProviders")); - }; - return ExternalSecurityGroupProviderRepository; -}()); -exports.ExternalSecurityGroupProviderRepository = ExternalSecurityGroupProviderRepository; - +//# sourceMappingURL=dynamicExtensionsFeaturesMetadataResource.js.map /***/ }), -/***/ 4387: +/***/ 91606: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExternalSecurityGroupRepository = void 0; -var ExternalSecurityGroupRepository = /** @class */ (function () { - function ExternalSecurityGroupRepository(client) { - this.client = client; - } - ExternalSecurityGroupRepository.prototype.search = function (url, partialName) { - return this.client.get(url, { partialName: partialName }); - }; - return ExternalSecurityGroupRepository; -}()); -exports.ExternalSecurityGroupRepository = ExternalSecurityGroupRepository; - +//# sourceMappingURL=dynamicExtensionsFeaturesValuesResource.js.map /***/ }), -/***/ 55459: +/***/ 85284: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExternalUsersRepository = void 0; -var ExternalUsersRepository = /** @class */ (function () { - function ExternalUsersRepository(client) { - this.client = client; - } - ExternalUsersRepository.prototype.search = function (partialName) { - return this.client.get(this.client.getLink("ExternalUserSearch"), { partialName: partialName }); - }; - ExternalUsersRepository.prototype.searchProvider = function (providerUrl, partialName) { - return this.client.get(providerUrl, { partialName: partialName }); - }; - return ExternalUsersRepository; -}()); -exports.ExternalUsersRepository = ExternalUsersRepository; - +//# sourceMappingURL=dynamicExtensionsScriptsResource.js.map /***/ }), -/***/ 56116: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 36747: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FeaturesConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var FeaturesConfigurationRepository = /** @class */ (function (_super) { - __extends(FeaturesConfigurationRepository, _super); - function FeaturesConfigurationRepository(client) { - return _super.call(this, "FeaturesConfiguration", client) || this; - } - return FeaturesConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.FeaturesConfigurationRepository = FeaturesConfigurationRepository; - +exports.ConnectivityCheckResponseMessageCategory = exports.PropertyApplicabilityMode = void 0; +var PropertyApplicabilityMode; +(function (PropertyApplicabilityMode) { + PropertyApplicabilityMode["ApplicableIfHasAnyValue"] = "ApplicableIfHasAnyValue"; + PropertyApplicabilityMode["ApplicableIfHasNoValue"] = "ApplicableIfHasNoValue"; + PropertyApplicabilityMode["ApplicableIfSpecificValue"] = "ApplicableIfSpecificValue"; + PropertyApplicabilityMode["ApplicableIfNotSpecificValue"] = "ApplicableIfNotSpecificValue"; +})(PropertyApplicabilityMode = exports.PropertyApplicabilityMode || (exports.PropertyApplicabilityMode = {})); +var ConnectivityCheckResponseMessageCategory; +(function (ConnectivityCheckResponseMessageCategory) { + ConnectivityCheckResponseMessageCategory["Info"] = "Info"; + ConnectivityCheckResponseMessageCategory["Warning"] = "Warning"; + ConnectivityCheckResponseMessageCategory["Error"] = "Error"; +})(ConnectivityCheckResponseMessageCategory = exports.ConnectivityCheckResponseMessageCategory || (exports.ConnectivityCheckResponseMessageCategory = {})); +//# sourceMappingURL=dynamicFormResources.js.map /***/ }), -/***/ 20037: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 34830: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/consistent-type-assertions */ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FeedRepository = exports.ExternalFeedsFilterTypes = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var basicRepository_1 = __nccwpck_require__(30970); -var ExternalFeedsFilterTypes = /** @class */ (function () { - function ExternalFeedsFilterTypes() { - } - Object.defineProperty(ExternalFeedsFilterTypes, "defaultFilterTypes", { - get: function () { - return this._defaultFilterTypes; - }, - enumerable: false, - configurable: true - }); - ExternalFeedsFilterTypes._defaultFilterTypes = Object.keys(message_contracts_1.FeedType) - .filter(function (f) { return f !== message_contracts_1.FeedType.BuiltIn && f !== message_contracts_1.FeedType.OctopusProject; }) - .map(function (f) { return f; }); - return ExternalFeedsFilterTypes; -}()); -exports.ExternalFeedsFilterTypes = ExternalFeedsFilterTypes; -var FeedRepository = /** @class */ (function (_super) { - __extends(FeedRepository, _super); - function FeedRepository(client) { - return _super.call(this, "Feeds", client) || this; - } - FeedRepository.prototype.getBuiltIn = function () { - return __awaiter(this, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.client.get(this.client.getLink("Feeds"), { feedType: message_contracts_1.FeedType.BuiltIn })]; - case 1: - result = _a.sent(); - return [2 /*return*/, result.Items[0]]; - } - }); - }); - }; - FeedRepository.prototype.getOctopusProject = function () { - return __awaiter(this, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.client.get(this.client.getLink("Feeds"), { feedType: message_contracts_1.FeedType.OctopusProject })]; - case 1: - result = _a.sent(); - return [2 /*return*/, result.Items[0]]; - } - }); - }); - }; - FeedRepository.prototype.getBuiltInStatus = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.client.get(this.client.getLink("BuiltInFeedStats"))]; - }); - }); - }; - FeedRepository.prototype.listExternal = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.client.get(this.client.getLink("Feeds"), { feedType: ExternalFeedsFilterTypes.defaultFilterTypes })]; - }); - }); - }; - FeedRepository.prototype.searchPackages = function (feed, searchOptions) { - return this.client.get(feed.Links.SearchPackagesTemplate, searchOptions); - }; - FeedRepository.prototype.searchPackageVersions = function (feed, packageId, searchOptions) { - return this.client.get(feed.Links["SearchPackageVersionsTemplate"], __assign({ packageId: packageId }, searchOptions)); - }; - FeedRepository.prototype.getNotes = function (feed, packageId, version) { - return this.client.getRaw(feed.Links["NotesTemplate"], { packageId: packageId, version: version }); - }; - return FeedRepository; -}(basicRepository_1.BasicRepository)); -exports.FeedRepository = FeedRepository; - +exports.EmailPriority = void 0; +var EmailPriority; +(function (EmailPriority) { + EmailPriority["Low"] = "Low"; + EmailPriority["Normal"] = "Normal"; + EmailPriority["High"] = "High"; +})(EmailPriority = exports.EmailPriority || (exports.EmailPriority = {})); +//# sourceMappingURL=emailPriority.js.map /***/ }), -/***/ 18029: +/***/ 93373: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ImportExportActions = void 0; -var ImportExportActions = /** @class */ (function () { - function ImportExportActions(client) { - this.client = client; - } - ImportExportActions.prototype.export = function (exportRequest) { - return this.client.post(this.client.getLink("ExportProjects"), exportRequest); - }; - ImportExportActions.prototype.files = function () { - return this.client.get(this.client.getLink("ProjectImportFiles")); - }; - ImportExportActions.prototype.import = function (importRequest) { - return this.client.post(this.client.getLink("ImportProjects"), importRequest); - }; - ImportExportActions.prototype.preview = function (importRequest) { - return this.client.post(this.client.getLink("ProjectImportPreview"), importRequest); - }; - ImportExportActions.prototype.upload = function (pkg) { - var fd = new FormData(); - fd.append("fileToUpload", pkg); - return this.client.post(this.client.getLink("ProjectImportFiles"), fd); +exports.NewEndpoint = void 0; +function NewEndpoint(name, communicationStyle) { + return { + CommunicationStyle: communicationStyle, + Name: name, }; - return ImportExportActions; -}()); -exports.ImportExportActions = ImportExportActions; - +} +exports.NewEndpoint = NewEndpoint; +//# sourceMappingURL=endpointResource.js.map /***/ }), -/***/ 90977: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 34042: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InterruptionRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var InterruptionRepository = /** @class */ (function (_super) { - __extends(InterruptionRepository, _super); - function InterruptionRepository(client) { - return _super.call(this, "Interruptions", client) || this; - } - InterruptionRepository.prototype.submit = function (interruption, result) { - return this.client.post(interruption.Links["Submit"], result); - }; - InterruptionRepository.prototype.takeResponsibility = function (interruption) { - return this.client.put(interruption.Links["Responsible"]); - }; - return InterruptionRepository; -}(basicRepository_1.BasicRepository)); -exports.InterruptionRepository = InterruptionRepository; - +//# sourceMappingURL=environmentResource.js.map /***/ }), -/***/ 15228: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 31719: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InvitationRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var InvitationRepository = /** @class */ (function (_super) { - __extends(InvitationRepository, _super); - function InvitationRepository(client) { - return _super.call(this, "Invitations", client) || this; - } - InvitationRepository.prototype.invite = function (teamIds, spaceId) { - return this.client.post(this.client.getLink("Invitations"), { AddToTeamIds: teamIds, SpaceId: spaceId }); - }; - return InvitationRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.InvitationRepository = InvitationRepository; +//# sourceMappingURL=environmentResourceLinks.js.map + +/***/ }), + +/***/ 78157: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=environmentSummaryResource.js.map /***/ }), -/***/ 78681: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 47479: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LetsEncryptConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var LetsEncryptConfigurationRepository = /** @class */ (function (_super) { - __extends(LetsEncryptConfigurationRepository, _super); - function LetsEncryptConfigurationRepository(client) { - return _super.call(this, "LetsEncryptConfiguration", client) || this; - } - return LetsEncryptConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.LetsEncryptConfigurationRepository = LetsEncryptConfigurationRepository; +//# sourceMappingURL=environmentsSummaryResource.js.map + +/***/ }), + +/***/ 16470: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=eventNotificationSubscription.js.map /***/ }), -/***/ 64693: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 50710: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LibraryVariableRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var LibraryVariableRepository = /** @class */ (function (_super) { - __extends(LibraryVariableRepository, _super); - function LibraryVariableRepository(client) { - return _super.call(this, "LibraryVariables", client) || this; - } - LibraryVariableRepository.prototype.getUsages = function (libraryVariableSet) { - return this.client.get(libraryVariableSet.Links["Usages"]); - }; - return LibraryVariableRepository; -}(basicRepository_1.BasicRepository)); -exports.LibraryVariableRepository = LibraryVariableRepository; +//# sourceMappingURL=eventNotificationSubscriptionFilter.js.map + +/***/ }), + +/***/ 27811: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=eventResource.js.map /***/ }), -/***/ 51916: +/***/ 82718: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LicenseRepository = void 0; -var LicenseRepository = /** @class */ (function () { - function LicenseRepository(client) { - this.client = client; - } - LicenseRepository.prototype.getCurrent = function () { - return this.client.get(this.client.getLink("CurrentLicense")); - }; - LicenseRepository.prototype.getCurrentStatus = function () { - return this.client.get(this.client.getLink("CurrentLicenseStatus")); - }; - LicenseRepository.prototype.modifyCurrent = function (resource) { - return this.client.update(resource.Links.Self, resource); - }; - return LicenseRepository; -}()); -exports.LicenseRepository = LicenseRepository; +//# sourceMappingURL=extensionSettingsValues.js.map + +/***/ }), + +/***/ 62851: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=extensionsInfoResource.js.map /***/ }), -/***/ 56946: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 28075: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LifecycleRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var LifecycleRepository = /** @class */ (function (_super) { - __extends(LifecycleRepository, _super); - function LifecycleRepository(client) { - return _super.call(this, "Lifecycles", client) || this; - } - LifecycleRepository.prototype.preview = function (lifecycle) { - return this.client.get(lifecycle.Links["Preview"]); - }; - LifecycleRepository.prototype.projects = function (lifecycle) { - return this.client.get(lifecycle.Links["Projects"]); - }; - return LifecycleRepository; -}(basicRepository_1.BasicRepository)); -exports.LifecycleRepository = LifecycleRepository; +//# sourceMappingURL=externalSecurityGroupProviderResource.js.map + +/***/ }), + +/***/ 42769: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=featuresConfigurationResource.js.map /***/ }), -/***/ 3522: -/***/ (function(__unused_webpack_module, exports) { +/***/ 37877: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.saveLogo = exports.uploadLogo = void 0; -function uploadLogo(client, resource, logo) { - var fd = new FormData(); - fd.append("fileToUpload", logo); - return client.post(resource.Links["Logo"], fd); +exports.getFeedTypeLabel = exports.isContainerImageRegistry = exports.containerRegistryFeedTypes = exports.isOctopusProjectFeed = exports.feedTypeSupportsExtraction = exports.feedTypeCanSearchEmpty = void 0; +var feedType_1 = __nccwpck_require__(30090); +var lodash_1 = __nccwpck_require__(90250); +function feedTypeCanSearchEmpty(feed) { + return ![ + feedType_1.FeedType.Docker, + feedType_1.FeedType.AwsElasticContainerRegistry, + feedType_1.FeedType.Maven, + feedType_1.FeedType.GitHub, + ].includes(feed); } -exports.uploadLogo = uploadLogo; -function saveLogo(client, resource, file, reset) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - // Important: when using saveLogo - // We upload the logo first so that when we do the model save we get back a new url for logo - if (file) { - return [2 /*return*/, uploadLogo(client, resource, file)]; - } - else if (reset) { - return [2 /*return*/, uploadLogo(client, resource, null)]; - } - return [2 /*return*/]; - }); - }); +exports.feedTypeCanSearchEmpty = feedTypeCanSearchEmpty; +function feedTypeSupportsExtraction(feed) { + return ![feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry].includes(feed); } -exports.saveLogo = saveLogo; - +exports.feedTypeSupportsExtraction = feedTypeSupportsExtraction; +function isOctopusProjectFeed(feed) { + return feed === "OctopusProject"; +} +exports.isOctopusProjectFeed = isOctopusProjectFeed; +function containerRegistryFeedTypes() { + return [feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry]; +} +exports.containerRegistryFeedTypes = containerRegistryFeedTypes; +function isContainerImageRegistry(feed) { + return containerRegistryFeedTypes().includes(feed); +} +exports.isContainerImageRegistry = isContainerImageRegistry; +var getFeedTypeLabel = function (feedType) { + var requiresContainerImageRegistryFeed = feedType && + feedType.length >= 1 && + (0, lodash_1.every)(feedType, function (f) { return isContainerImageRegistry(f); }); + var requiresHelmChartFeed = feedType && feedType.length === 1 && feedType[0] === feedType_1.FeedType.Helm; + if (requiresContainerImageRegistryFeed) { + return "Container Image Registry"; + } + if (requiresHelmChartFeed) { + return "Helm Chart Repository"; + } + return "Package"; +}; +exports.getFeedTypeLabel = getFeedTypeLabel; +//# sourceMappingURL=feedResource.js.map /***/ }), -/***/ 154: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 30090: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachinePolicyRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var MachinePolicyRepository = /** @class */ (function (_super) { - __extends(MachinePolicyRepository, _super); - function MachinePolicyRepository(client) { - return _super.call(this, "MachinePolicies", client) || this; - } - MachinePolicyRepository.prototype.getTemplate = function () { - return this.client.get(this.client.getLink("MachinePolicyTemplate")); - }; - MachinePolicyRepository.prototype.getMachines = function (machinePolicy) { - return this.client.get(machinePolicy.Links["Machines"]); - }; - MachinePolicyRepository.prototype.getWorkers = function (machinePolicy) { - return this.client.get(machinePolicy.Links["Workers"]); - }; - return MachinePolicyRepository; -}(basicRepository_1.BasicRepository)); -exports.MachinePolicyRepository = MachinePolicyRepository; - +exports.FeedType = void 0; +var FeedType; +(function (FeedType) { + FeedType["AwsElasticContainerRegistry"] = "AwsElasticContainerRegistry"; + FeedType["BuiltIn"] = "BuiltIn"; + FeedType["Docker"] = "Docker"; + FeedType["GitHub"] = "GitHub"; + FeedType["Helm"] = "Helm"; + FeedType["Maven"] = "Maven"; + FeedType["Nuget"] = "NuGet"; + FeedType["OctopusProject"] = "OctopusProject"; +})(FeedType = exports.FeedType || (exports.FeedType = {})); +//# sourceMappingURL=feedType.js.map /***/ }), -/***/ 53015: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 11110: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -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); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineRepository = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var basicRepository_1 = __nccwpck_require__(30970); -var MachineRepository = /** @class */ (function (_super) { - __extends(MachineRepository, _super); - function MachineRepository(client) { - return _super.call(this, "Machines", client) || this; - } - MachineRepository.prototype.discover = function (host, port, type, proxyId) { - return proxyId ? this.client.get(this.client.getLink("DiscoverMachine"), { host: host, port: port, type: type, proxyId: proxyId }) : this.client.get(this.client.getLink("DiscoverMachine"), { host: host, port: port, type: type }); - }; - MachineRepository.prototype.getConnectionStatus = function (machine) { - return this.client.get(machine.Links["Connection"]); - }; - MachineRepository.prototype.getDeployments = function (machine, options) { - return this.client.get(machine.Links["TasksTemplate"], __assign(__assign({}, options), { type: message_contracts_1.DeploymentTargetTaskType.Deployment })); - }; - MachineRepository.prototype.getRunbookRuns = function (machine, options) { - return this.client.get(machine.Links["TasksTemplate"], __assign(__assign({}, options), { type: message_contracts_1.DeploymentTargetTaskType.RunbookRun })); - }; - MachineRepository.prototype.hosted = function () { - var allArgs = { id: "hosted" }; - return this.client.get(this.client.getLink("Machines"), allArgs); - }; - MachineRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink("Machines"), args); - }; - MachineRepository.prototype.listByDeployment = function (deployment) { - return this.client.get(this.client.getLink("Machines"), { deploymentId: deployment.Id, id: "all" }); - }; - MachineRepository.prototype.listByEnvironment = function (environment) { - return this.client.get(environment.Links["Machines"]); - }; - return MachineRepository; -}(basicRepository_1.BasicRepository)); -exports.MachineRepository = MachineRepository; +exports.ControlType = void 0; +var ControlType; +(function (ControlType) { + ControlType["Checkbox"] = "Checkbox"; + ControlType["Paragraph"] = "Paragraph"; + ControlType["Button"] = "Button"; + ControlType["SubmitButtonGroup"] = "SubmitButtonGroup"; + ControlType["TextArea"] = "TextArea"; + ControlType["VariableValue"] = "VariableValue"; +})(ControlType = exports.ControlType || (exports.ControlType = {})); +//# sourceMappingURL=form.js.map + +/***/ }), + +/***/ 24542: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NewGoogleCloudAccount = void 0; +var accountType_1 = __nccwpck_require__(34914); +function NewGoogleCloudAccount(name, jsonKey) { + return { + AccountType: accountType_1.AccountType.GoogleCloudAccount, + JsonKey: jsonKey, + Name: name, + }; +} +exports.NewGoogleCloudAccount = NewGoogleCloudAccount; +//# sourceMappingURL=googleCloudAccountResource.js.map /***/ }), -/***/ 50197: +/***/ 32471: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineRoleRepository = void 0; -var MachineRoleRepository = /** @class */ (function () { - function MachineRoleRepository(client) { - this.client = client; - } - MachineRoleRepository.prototype.all = function () { - return this.client.get(this.client.getLink("MachineRoles")); - }; - return MachineRoleRepository; -}()); -exports.MachineRoleRepository = MachineRoleRepository; - +//# sourceMappingURL=identityMetadataResource.js.map /***/ }), -/***/ 1939: +/***/ 20366: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineShellsRepository = void 0; -var MachineShellsRepository = /** @class */ (function () { - function MachineShellsRepository(client) { - this.client = client; - } - MachineShellsRepository.prototype.all = function () { - return this.client.get(this.client.getLink("MachineShells")); - }; - return MachineShellsRepository; -}()); -exports.MachineShellsRepository = MachineShellsRepository; - +//# sourceMappingURL=identityResource.js.map /***/ }), -/***/ 94772: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 60157: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MaintenanceConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var MaintenanceConfigurationRepository = /** @class */ (function (_super) { - __extends(MaintenanceConfigurationRepository, _super); - function MaintenanceConfigurationRepository(client) { - return _super.call(this, "MaintenanceConfiguration", client) || this; - } - return MaintenanceConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.MaintenanceConfigurationRepository = MaintenanceConfigurationRepository; - +exports.IdentityType = void 0; +var IdentityType; +(function (IdentityType) { + IdentityType[IdentityType["Guest"] = 0] = "Guest"; + IdentityType[IdentityType["UsernamePassword"] = 1] = "UsernamePassword"; + IdentityType[IdentityType["ActiveDirectory"] = 2] = "ActiveDirectory"; + IdentityType[IdentityType["OAuth"] = 3] = "OAuth"; +})(IdentityType = exports.IdentityType || (exports.IdentityType = {})); +//# sourceMappingURL=identityType.js.map /***/ }), -/***/ 80891: +/***/ 74561: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.convertToSpacePartitionParameters = exports.MixedScopeBaseRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -// includeSystem is set to true by default, can be overridden by args -var MixedScopeBaseRepository = /** @class */ (function (_super) { - __extends(MixedScopeBaseRepository, _super); - function MixedScopeBaseRepository() { - return _super !== null && _super.apply(this, arguments) || this; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; } - MixedScopeBaseRepository.prototype.all = function (args) { - var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); - return _super.prototype.all.call(this, combinedArgs); - }; - MixedScopeBaseRepository.prototype.allById = function (args) { - var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); - return _super.prototype.allById.call(this, combinedArgs); - }; - MixedScopeBaseRepository.prototype.get = function (id, args) { - var allArgs = this.extend(args || {}, { id: id }); - var argsWithSpace = this.extend(allArgs, this.spacePartitionParameters()); - return _super.prototype.get.call(this, id, argsWithSpace); - }; - MixedScopeBaseRepository.prototype.list = function (args) { - var combinedArgs = _super.prototype.extend.call(this, this.spacePartitionParameters(), args); - return _super.prototype.list.call(this, combinedArgs); - }; - MixedScopeBaseRepository.prototype.spacePartitionParameters = function () { - return convertToSpacePartitionParameters(this.client.spaceId, true); - }; - return MixedScopeBaseRepository; -}(basicRepository_1.BasicRepository)); -exports.MixedScopeBaseRepository = MixedScopeBaseRepository; -function convertToSpacePartitionParameters(spaceId, includeSystem) { - var spaces = spaceId ? [spaceId] : []; - return { includeSystem: includeSystem, spaces: spaces }; -} -exports.convertToSpacePartitionParameters = convertToSpacePartitionParameters; - + Object.defineProperty(o, k2, desc); +}) : (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); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(21843), exports); +__exportStar(__nccwpck_require__(88253), exports); +__exportStar(__nccwpck_require__(35608), exports); +__exportStar(__nccwpck_require__(34914), exports); +__exportStar(__nccwpck_require__(6687), exports); +__exportStar(__nccwpck_require__(7689), exports); +__exportStar(__nccwpck_require__(9801), exports); +__exportStar(__nccwpck_require__(71517), exports); +__exportStar(__nccwpck_require__(6531), exports); +__exportStar(__nccwpck_require__(30597), exports); +__exportStar(__nccwpck_require__(10136), exports); +__exportStar(__nccwpck_require__(9947), exports); +__exportStar(__nccwpck_require__(48998), exports); +__exportStar(__nccwpck_require__(47799), exports); +__exportStar(__nccwpck_require__(34440), exports); +__exportStar(__nccwpck_require__(49241), exports); +__exportStar(__nccwpck_require__(53132), exports); +__exportStar(__nccwpck_require__(56543), exports); +__exportStar(__nccwpck_require__(40407), exports); +__exportStar(__nccwpck_require__(99710), exports); +__exportStar(__nccwpck_require__(34926), exports); +__exportStar(__nccwpck_require__(80778), exports); +__exportStar(__nccwpck_require__(94582), exports); +__exportStar(__nccwpck_require__(30939), exports); +__exportStar(__nccwpck_require__(18304), exports); +__exportStar(__nccwpck_require__(58502), exports); +__exportStar(__nccwpck_require__(16089), exports); +__exportStar(__nccwpck_require__(38639), exports); +__exportStar(__nccwpck_require__(72866), exports); +__exportStar(__nccwpck_require__(64699), exports); +__exportStar(__nccwpck_require__(39349), exports); +__exportStar(__nccwpck_require__(92669), exports); +__exportStar(__nccwpck_require__(27134), exports); +__exportStar(__nccwpck_require__(66707), exports); +__exportStar(__nccwpck_require__(27673), exports); +__exportStar(__nccwpck_require__(60035), exports); +__exportStar(__nccwpck_require__(91173), exports); +__exportStar(__nccwpck_require__(42969), exports); +__exportStar(__nccwpck_require__(33477), exports); +__exportStar(__nccwpck_require__(39021), exports); +__exportStar(__nccwpck_require__(50699), exports); +__exportStar(__nccwpck_require__(94840), exports); +__exportStar(__nccwpck_require__(18754), exports); +__exportStar(__nccwpck_require__(90097), exports); +__exportStar(__nccwpck_require__(52739), exports); +__exportStar(__nccwpck_require__(78766), exports); +__exportStar(__nccwpck_require__(21303), exports); +__exportStar(__nccwpck_require__(3712), exports); +__exportStar(__nccwpck_require__(27734), exports); +__exportStar(__nccwpck_require__(19170), exports); +__exportStar(__nccwpck_require__(99930), exports); +__exportStar(__nccwpck_require__(42546), exports); +__exportStar(__nccwpck_require__(83382), exports); +__exportStar(__nccwpck_require__(20006), exports); +__exportStar(__nccwpck_require__(26289), exports); +__exportStar(__nccwpck_require__(64543), exports); +__exportStar(__nccwpck_require__(88640), exports); +__exportStar(__nccwpck_require__(21706), exports); +__exportStar(__nccwpck_require__(65120), exports); +__exportStar(__nccwpck_require__(60599), exports); +__exportStar(__nccwpck_require__(61676), exports); +__exportStar(__nccwpck_require__(71615), exports); +__exportStar(__nccwpck_require__(26994), exports); +__exportStar(__nccwpck_require__(40633), exports); +__exportStar(__nccwpck_require__(157), exports); +__exportStar(__nccwpck_require__(71976), exports); +__exportStar(__nccwpck_require__(81741), exports); +__exportStar(__nccwpck_require__(10322), exports); +__exportStar(__nccwpck_require__(9042), exports); +__exportStar(__nccwpck_require__(95369), exports); +__exportStar(__nccwpck_require__(48798), exports); +__exportStar(__nccwpck_require__(67788), exports); +__exportStar(__nccwpck_require__(69297), exports); +__exportStar(__nccwpck_require__(33162), exports); +__exportStar(__nccwpck_require__(91606), exports); +__exportStar(__nccwpck_require__(85284), exports); +__exportStar(__nccwpck_require__(36747), exports); +__exportStar(__nccwpck_require__(34830), exports); +__exportStar(__nccwpck_require__(93373), exports); +__exportStar(__nccwpck_require__(34042), exports); +__exportStar(__nccwpck_require__(31719), exports); +__exportStar(__nccwpck_require__(47479), exports); +__exportStar(__nccwpck_require__(78157), exports); +__exportStar(__nccwpck_require__(16470), exports); +__exportStar(__nccwpck_require__(50710), exports); +__exportStar(__nccwpck_require__(27811), exports); +__exportStar(__nccwpck_require__(82718), exports); +__exportStar(__nccwpck_require__(62851), exports); +__exportStar(__nccwpck_require__(28075), exports); +__exportStar(__nccwpck_require__(42769), exports); +__exportStar(__nccwpck_require__(37877), exports); +__exportStar(__nccwpck_require__(30090), exports); +__exportStar(__nccwpck_require__(24542), exports); +__exportStar(__nccwpck_require__(32471), exports); +__exportStar(__nccwpck_require__(20366), exports); +__exportStar(__nccwpck_require__(60157), exports); +__exportStar(__nccwpck_require__(5639), exports); +__exportStar(__nccwpck_require__(90938), exports); +__exportStar(__nccwpck_require__(56196), exports); +__exportStar(__nccwpck_require__(17700), exports); +__exportStar(__nccwpck_require__(3753), exports); +__exportStar(__nccwpck_require__(44688), exports); +__exportStar(__nccwpck_require__(32925), exports); +__exportStar(__nccwpck_require__(27467), exports); +__exportStar(__nccwpck_require__(82025), exports); +__exportStar(__nccwpck_require__(80464), exports); +__exportStar(__nccwpck_require__(92262), exports); +__exportStar(__nccwpck_require__(55847), exports); +__exportStar(__nccwpck_require__(92803), exports); +__exportStar(__nccwpck_require__(97218), exports); +__exportStar(__nccwpck_require__(54085), exports); +__exportStar(__nccwpck_require__(64605), exports); +__exportStar(__nccwpck_require__(95545), exports); +__exportStar(__nccwpck_require__(73927), exports); +__exportStar(__nccwpck_require__(57636), exports); +__exportStar(__nccwpck_require__(93176), exports); +__exportStar(__nccwpck_require__(72150), exports); +__exportStar(__nccwpck_require__(82705), exports); +__exportStar(__nccwpck_require__(59827), exports); +__exportStar(__nccwpck_require__(42463), exports); +__exportStar(__nccwpck_require__(51865), exports); +__exportStar(__nccwpck_require__(52939), exports); +__exportStar(__nccwpck_require__(22110), exports); +__exportStar(__nccwpck_require__(65688), exports); +__exportStar(__nccwpck_require__(72151), exports); +__exportStar(__nccwpck_require__(48920), exports); +__exportStar(__nccwpck_require__(84328), exports); +__exportStar(__nccwpck_require__(58858), exports); +__exportStar(__nccwpck_require__(81935), exports); +__exportStar(__nccwpck_require__(81286), exports); +__exportStar(__nccwpck_require__(12358), exports); +__exportStar(__nccwpck_require__(14239), exports); +__exportStar(__nccwpck_require__(17929), exports); +__exportStar(__nccwpck_require__(2847), exports); +__exportStar(__nccwpck_require__(50671), exports); +__exportStar(__nccwpck_require__(37648), exports); +__exportStar(__nccwpck_require__(35882), exports); +__exportStar(__nccwpck_require__(89010), exports); +__exportStar(__nccwpck_require__(66933), exports); +__exportStar(__nccwpck_require__(20928), exports); +__exportStar(__nccwpck_require__(79856), exports); +__exportStar(__nccwpck_require__(15259), exports); +__exportStar(__nccwpck_require__(60651), exports); +__exportStar(__nccwpck_require__(49346), exports); +__exportStar(__nccwpck_require__(54710), exports); +__exportStar(__nccwpck_require__(81148), exports); +__exportStar(__nccwpck_require__(32771), exports); +__exportStar(__nccwpck_require__(29703), exports); +__exportStar(__nccwpck_require__(70913), exports); +__exportStar(__nccwpck_require__(47875), exports); +__exportStar(__nccwpck_require__(62054), exports); +__exportStar(__nccwpck_require__(29029), exports); +__exportStar(__nccwpck_require__(95699), exports); +__exportStar(__nccwpck_require__(55795), exports); +__exportStar(__nccwpck_require__(24196), exports); +__exportStar(__nccwpck_require__(86630), exports); +__exportStar(__nccwpck_require__(70634), exports); +__exportStar(__nccwpck_require__(89763), exports); +__exportStar(__nccwpck_require__(97446), exports); +__exportStar(__nccwpck_require__(91535), exports); +__exportStar(__nccwpck_require__(40903), exports); +__exportStar(__nccwpck_require__(28620), exports); +__exportStar(__nccwpck_require__(13627), exports); +__exportStar(__nccwpck_require__(35168), exports); +__exportStar(__nccwpck_require__(43924), exports); +__exportStar(__nccwpck_require__(65898), exports); +__exportStar(__nccwpck_require__(91699), exports); +__exportStar(__nccwpck_require__(33437), exports); +__exportStar(__nccwpck_require__(97610), exports); +__exportStar(__nccwpck_require__(80014), exports); +__exportStar(__nccwpck_require__(25462), exports); +__exportStar(__nccwpck_require__(93411), exports); +__exportStar(__nccwpck_require__(22245), exports); +__exportStar(__nccwpck_require__(40496), exports); +__exportStar(__nccwpck_require__(42338), exports); +__exportStar(__nccwpck_require__(95297), exports); +__exportStar(__nccwpck_require__(96286), exports); +__exportStar(__nccwpck_require__(63216), exports); +__exportStar(__nccwpck_require__(62668), exports); +__exportStar(__nccwpck_require__(98411), exports); +__exportStar(__nccwpck_require__(36029), exports); +__exportStar(__nccwpck_require__(5899), exports); +__exportStar(__nccwpck_require__(11400), exports); +__exportStar(__nccwpck_require__(26571), exports); +__exportStar(__nccwpck_require__(19891), exports); +__exportStar(__nccwpck_require__(82034), exports); +__exportStar(__nccwpck_require__(77703), exports); +__exportStar(__nccwpck_require__(47106), exports); +__exportStar(__nccwpck_require__(34703), exports); +__exportStar(__nccwpck_require__(41816), exports); +__exportStar(__nccwpck_require__(24223), exports); +__exportStar(__nccwpck_require__(71606), exports); +__exportStar(__nccwpck_require__(63390), exports); +__exportStar(__nccwpck_require__(19038), exports); +__exportStar(__nccwpck_require__(39849), exports); +__exportStar(__nccwpck_require__(24752), exports); +__exportStar(__nccwpck_require__(54000), exports); +__exportStar(__nccwpck_require__(93704), exports); +__exportStar(__nccwpck_require__(49281), exports); +__exportStar(__nccwpck_require__(20114), exports); +__exportStar(__nccwpck_require__(93060), exports); +__exportStar(__nccwpck_require__(32196), exports); +__exportStar(__nccwpck_require__(82342), exports); +__exportStar(__nccwpck_require__(66197), exports); +__exportStar(__nccwpck_require__(95317), exports); +__exportStar(__nccwpck_require__(64507), exports); +__exportStar(__nccwpck_require__(26498), exports); +__exportStar(__nccwpck_require__(10171), exports); +__exportStar(__nccwpck_require__(37396), exports); +__exportStar(__nccwpck_require__(22152), exports); +__exportStar(__nccwpck_require__(33543), exports); +__exportStar(__nccwpck_require__(94565), exports); +__exportStar(__nccwpck_require__(32841), exports); +__exportStar(__nccwpck_require__(57461), exports); +__exportStar(__nccwpck_require__(24458), exports); +__exportStar(__nccwpck_require__(75507), exports); +__exportStar(__nccwpck_require__(42857), exports); +__exportStar(__nccwpck_require__(19863), exports); +__exportStar(__nccwpck_require__(50606), exports); +__exportStar(__nccwpck_require__(65252), exports); +__exportStar(__nccwpck_require__(51140), exports); +__exportStar(__nccwpck_require__(38664), exports); +__exportStar(__nccwpck_require__(44990), exports); +__exportStar(__nccwpck_require__(30874), exports); +__exportStar(__nccwpck_require__(87516), exports); +__exportStar(__nccwpck_require__(84199), exports); +__exportStar(__nccwpck_require__(84955), exports); +__exportStar(__nccwpck_require__(36445), exports); +__exportStar(__nccwpck_require__(20736), exports); +__exportStar(__nccwpck_require__(54797), exports); +__exportStar(__nccwpck_require__(68517), exports); +__exportStar(__nccwpck_require__(31113), exports); +__exportStar(__nccwpck_require__(67683), exports); +__exportStar(__nccwpck_require__(77693), exports); +__exportStar(__nccwpck_require__(70229), exports); +__exportStar(__nccwpck_require__(34170), exports); +__exportStar(__nccwpck_require__(58574), exports); +__exportStar(__nccwpck_require__(1033), exports); +__exportStar(__nccwpck_require__(30292), exports); +__exportStar(__nccwpck_require__(78010), exports); +__exportStar(__nccwpck_require__(54638), exports); +__exportStar(__nccwpck_require__(41823), exports); +__exportStar(__nccwpck_require__(69838), exports); +__exportStar(__nccwpck_require__(54861), exports); +__exportStar(__nccwpck_require__(45206), exports); +__exportStar(__nccwpck_require__(36604), exports); +__exportStar(__nccwpck_require__(50872), exports); +__exportStar(__nccwpck_require__(24456), exports); +__exportStar(__nccwpck_require__(7151), exports); +__exportStar(__nccwpck_require__(90269), exports); +__exportStar(__nccwpck_require__(32280), exports); +__exportStar(__nccwpck_require__(36186), exports); +__exportStar(__nccwpck_require__(71879), exports); +__exportStar(__nccwpck_require__(71283), exports); +__exportStar(__nccwpck_require__(63823), exports); +__exportStar(__nccwpck_require__(94620), exports); +__exportStar(__nccwpck_require__(82668), exports); +__exportStar(__nccwpck_require__(24090), exports); +__exportStar(__nccwpck_require__(3282), exports); +__exportStar(__nccwpck_require__(99028), exports); +__exportStar(__nccwpck_require__(44021), exports); +__exportStar(__nccwpck_require__(31613), exports); +__exportStar(__nccwpck_require__(48773), exports); +__exportStar(__nccwpck_require__(51578), exports); +__exportStar(__nccwpck_require__(30742), exports); +__exportStar(__nccwpck_require__(17678), exports); +__exportStar(__nccwpck_require__(51496), exports); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 34819: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 5639: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OctopusServerNodeRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var OctopusServerNodeRepository = /** @class */ (function (_super) { - __extends(OctopusServerNodeRepository, _super); - function OctopusServerNodeRepository(client) { - return _super.call(this, "OctopusServerNodes", client) || this; - } - OctopusServerNodeRepository.prototype.del = function (resource) { - var _this = this; - return this.client.del(resource.Links.Node).then(function (d) { return _this.notifySubscribersToDataModifications(resource); }); - }; - //technically deprecated, as its not called from the UI. - //introduced in 2019.1.0, the code that called it got changed soon after - OctopusServerNodeRepository.prototype.details = function (node) { - return this.client.get(node.Links["Details"]); - }; - OctopusServerNodeRepository.prototype.summary = function () { - return this.client.get(this.client.getLink("OctopusServerClusterSummary")); - }; - return OctopusServerNodeRepository; -}(basicRepository_1.BasicRepository)); -exports.OctopusServerNodeRepository = OctopusServerNodeRepository; - +//# sourceMappingURL=interruptionResource.js.map /***/ }), -/***/ 53378: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 90938: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageRepository = exports.OverwriteMode = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var OverwriteMode; -(function (OverwriteMode) { - OverwriteMode[OverwriteMode["FailIfExists"] = 0] = "FailIfExists"; - OverwriteMode[OverwriteMode["OverwriteExisting"] = 1] = "OverwriteExisting"; - OverwriteMode[OverwriteMode["IgnoreIfExists"] = 2] = "IgnoreIfExists"; -})(OverwriteMode = exports.OverwriteMode || (exports.OverwriteMode = {})); -var PackageRepository = /** @class */ (function (_super) { - __extends(PackageRepository, _super); - function PackageRepository(client) { - return _super.call(this, "Packages", client) || this; - } - PackageRepository.prototype.deleteMany = function (packageIds) { - return this.client.del(this.client.getLink("PackagesBulk"), null, { ids: packageIds }); - }; - PackageRepository.prototype.upload = function (pkg, overwriteMode) { - if (overwriteMode === void 0) { overwriteMode = OverwriteMode.FailIfExists; } - var fd = new FormData(); - fd.append("fileToUpload", pkg); - return this.client.post(this.client.getLink("PackageUpload"), fd, { overwriteMode: overwriteMode }); - }; - PackageRepository.prototype.getNotes = function (packages) { - var packageIds = packages.reduce(function (result, item) { - return result + - (result.length === 0 ? "" : ",") + - encodeURIComponent(item.FeedId) + - ":" + - encodeURIComponent(item.PackageId) + - ":" + - encodeURIComponent(item.Version); - }, ""); - return this.client.get(this.client.getLink("PackageNotesList"), { packageIds: packageIds }); - }; - return PackageRepository; -}(basicRepository_1.BasicRepository)); -exports.PackageRepository = PackageRepository; +//# sourceMappingURL=invitationResource.js.map + +/***/ }), + +/***/ 56196: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.KubernetesAuthenticationType = void 0; +var KubernetesAuthenticationType; +(function (KubernetesAuthenticationType) { + KubernetesAuthenticationType["KubernetesAws"] = "KubernetesAws"; + KubernetesAuthenticationType["KubernetesAzure"] = "KubernetesAzure"; + KubernetesAuthenticationType["KubernetesCertificate"] = "KubernetesCertificate"; + KubernetesAuthenticationType["KubernetesGoogleCloud"] = "KubernetesGoogleCloud"; + KubernetesAuthenticationType["KubernetesPodServiceAccount"] = "KubernetesPodService"; + KubernetesAuthenticationType["KubernetesStandard"] = "KubernetesStandard"; +})(KubernetesAuthenticationType = exports.KubernetesAuthenticationType || (exports.KubernetesAuthenticationType = {})); +//# sourceMappingURL=kubernetesAuthenticationType.js.map /***/ }), -/***/ 21797: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 17700: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PerformanceConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var PerformanceConfigurationRepository = /** @class */ (function (_super) { - __extends(PerformanceConfigurationRepository, _super); - function PerformanceConfigurationRepository(client) { - return _super.call(this, "PerformanceConfiguration", client) || this; - } - return PerformanceConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.PerformanceConfigurationRepository = PerformanceConfigurationRepository; - +//# sourceMappingURL=letsEncryptConfigurationResource.js.map /***/ }), -/***/ 97886: +/***/ 3753: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PermissionDescriptionRepository = void 0; -var PermissionDescriptionRepository = /** @class */ (function () { - function PermissionDescriptionRepository(client) { - this.client = client; - } - PermissionDescriptionRepository.prototype.all = function () { - return this.client.get(this.client.getLink("PermissionDescriptions"), null); - }; - return PermissionDescriptionRepository; -}()); -exports.PermissionDescriptionRepository = PermissionDescriptionRepository; +//# sourceMappingURL=libraryVariableSetResource.js.map + +/***/ }), + +/***/ 44688: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=libraryVariableSetUsageEntry.js.map /***/ }), -/***/ 53127: +/***/ 32925: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProgressionRepository = void 0; -var ProgressionRepository = /** @class */ (function () { - function ProgressionRepository(client) { - this.client = client; - } - ProgressionRepository.prototype.getProgression = function (project, options) { - return this.client.get(project.Links["Progression"], options); - }; - ProgressionRepository.prototype.getRunbookProgression = function (runbook, options) { - return this.client.get(runbook.Links["Progression"], options); - }; - ProgressionRepository.prototype.getTaskRunDashboardItemsForProject = function (project, options) { - return this.client.get(project.Links["RunbookTaskRunDashboardItemsTemplate"], options); - }; - ProgressionRepository.prototype.getTaskRunDashboardItemsForRunbook = function (runbook, options) { - return this.client.get(runbook.Links["TaskRunDashboardItemsTemplate"], options); - }; - return ProgressionRepository; -}()); -exports.ProgressionRepository = ProgressionRepository; +//# sourceMappingURL=libraryVariableSetUsageResource.js.map + +/***/ }), + +/***/ 27467: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=licenseResource.js.map /***/ }), -/***/ 38331: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 82025: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProjectGroupRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ProjectGroupRepository = /** @class */ (function (_super) { - __extends(ProjectGroupRepository, _super); - function ProjectGroupRepository(client) { - return _super.call(this, "ProjectGroups", client) || this; - } - return ProjectGroupRepository; -}(basicRepository_1.BasicRepository)); -exports.ProjectGroupRepository = ProjectGroupRepository; +exports.LicenseMessageDisposition = exports.PermissionsMode = exports.HostingEnvironment = void 0; +var HostingEnvironment; +(function (HostingEnvironment) { + HostingEnvironment["SelfHosted"] = "SelfHosted"; + HostingEnvironment["OctopusCloud"] = "OctopusCloud"; +})(HostingEnvironment = exports.HostingEnvironment || (exports.HostingEnvironment = {})); +var PermissionsMode; +(function (PermissionsMode) { + PermissionsMode["Unspecified"] = "Unspecified"; + PermissionsMode["Restricted"] = "Restricted"; + PermissionsMode["Full"] = "Full"; +})(PermissionsMode = exports.PermissionsMode || (exports.PermissionsMode = {})); +var LicenseMessageDisposition; +(function (LicenseMessageDisposition) { + LicenseMessageDisposition["Information"] = "Information"; + LicenseMessageDisposition["Warning"] = "Warning"; + LicenseMessageDisposition["Error"] = "Error"; +})(LicenseMessageDisposition = exports.LicenseMessageDisposition || (exports.LicenseMessageDisposition = {})); +//# sourceMappingURL=licenseStatusResource.js.map + +/***/ }), + +/***/ 80464: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=lifecycleProgressionResource.js.map /***/ }), -/***/ 52058: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 92262: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable @typescript-eslint/no-non-null-assertion,@typescript-eslint/consistent-type-assertions */ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UseDefaultBranch = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var basicRepository_1 = __nccwpck_require__(30970); -exports.UseDefaultBranch = { UseDefaultBranch: true }; -var ProjectRepository = /** @class */ (function (_super) { - __extends(ProjectRepository, _super); - function ProjectRepository(client) { - return _super.call(this, "Projects", client) || this; - } - ProjectRepository.prototype.find = function (nameOrId) { - return __awaiter(this, void 0, void 0, function () { - var _a, projects; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (nameOrId.length === 0) - return [2 /*return*/]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.get(nameOrId)]; - case 2: return [2 /*return*/, _b.sent()]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: return [4 /*yield*/, this.list({ - partialName: nameOrId, - })]; - case 5: - projects = _b.sent(); - return [2 /*return*/, projects.Items.find(function (p) { return p.Name === nameOrId; })]; - } - }); - }); - }; - ProjectRepository.prototype.getChannels = function (project, gitRef, skip, take) { - if (skip === void 0) { skip = 0; } - if (take === void 0) { take = this.takeAll; } - if (gitRef && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { - return this.client.get(project.Links["Channels"], { skip: skip, take: take, gitRef: gitRef }); - } - return this.client.get(project.Links["Channels"], { skip: skip, take: take }); - }; - ProjectRepository.prototype.getDeployments = function (project) { - return this.client.get(this.client.getLink("Deployments"), { projects: project.Id }); - }; - ProjectRepository.prototype.getDeploymentSettings = function (project, gitRef) { - if (gitRef && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { - return this.client.get(project.Links["DeploymentSettings"], { gitRef: gitRef }); - } - return this.client.get(project.Links["DeploymentSettings"]); - }; - ProjectRepository.prototype.getReleases = function (project, args) { - return this.client.get(project.Links["Releases"], args); - }; - ProjectRepository.prototype.getReleaseByVersion = function (project, version) { - return this.client.get(project.Links["Releases"], { version: version }); - }; - ProjectRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink("Projects"), __assign({}, args)); - }; - ProjectRepository.prototype.listByGroup = function (projectGroup) { - return this.client.get(projectGroup.Links["Projects"]); - }; - ProjectRepository.prototype.getTriggers = function (project, gitRef, skip, take, triggerActionType, triggerActionCategory, runbooks, partialName) { - return this.client.get(project.Links["Triggers"], { - skip: skip, - take: take, - gitRef: gitRef, - triggerActionType: triggerActionType, - triggerActionCategory: triggerActionCategory, - runbooks: runbooks, - partialName: partialName, - }); - }; - ProjectRepository.prototype.orderChannels = function (project) { - return this.client.post(project.Links["OrderChannels"]); - }; - ProjectRepository.prototype.getPulse = function (projects) { - var projectIds = projects - .map(function (p) { - return p.Id; - }) - .join(","); - return this.client.get(this.client.getLink("ProjectPulse"), { projectIds: projectIds }); - }; - ProjectRepository.prototype.getMetadata = function (project) { - return this.client.get(project.Links["Metadata"], {}); - }; - ProjectRepository.prototype.getRunbooks = function (project, args) { - return this.client.get(project.Links["Runbooks"], args); - }; - ProjectRepository.prototype.summaries = function () { - return this.client.get(this.client.getLink("ProjectsExperimentalSummaries")); - }; - ProjectRepository.prototype.getSummary = function (project, branch) { - return this.client.get(project.Links["Summary"], { gitRef: GetBranchDetails(branch) }); - }; - ProjectRepository.prototype.getBranch = function (project, branch) { - if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links) && (0, message_contracts_1.HasVersionControlledPersistenceSettings)(project.PersistenceSettings)) { - var branchName = ShouldUseDefaultBranch(branch) ? project.PersistenceSettings.DefaultBranch : branch; - return this.client.get(project.Links.Branches, { name: branchName }); - } - throw new Error("Cannot retrieve branches from non-VCS projects"); - }; - ProjectRepository.prototype.getBranches = function (project) { - if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links)) { - return this.client.get(project.Links.Branches); - } - throw new Error("Cannot retrieve branches from non-VCS projects"); - }; - ProjectRepository.prototype.searchBranches = function (project, partialBranchName) { - if ((0, message_contracts_1.HasVcsProjectResourceLinks)(project.Links)) { - return this.client.get(project.Links.Branches, { searchByName: partialBranchName }); - } - throw new Error("Cannot retrieve branches from non-VCS projects"); - }; - ProjectRepository.prototype.convertToVcs = function (project, payload) { - return this.client.post(project.Links.ConvertToVcs, payload); - }; - ProjectRepository.prototype.vcsCompatibilityReport = function (project) { - return this.client.get(project.Links["VersionControlCompatibilityReport"]); - }; - // TODO: @team-config-as-code - Our project needs a custom "Delete" link that does _not_ include the GitRef in order for us to - // successfully hit the /projects/{id} DEL endpoint. For EAP, we're out of time and just hacking it into the frontend client. - ProjectRepository.prototype.del = function (project) { - var _this = this; - if (project.IsVersionControlled) { - // Our "Self" link should currently include the GitRef. If so, and our last path does not look like our projectId, strip it. - var selfLinkParts = project.Links.Self.split("/"); - if (selfLinkParts[selfLinkParts.length - 1] !== project.Id) { - selfLinkParts.pop(); - } - var selfLink = selfLinkParts.join("/"); - return this.client.del(selfLink).then(function (d) { return _this.notifySubscribersToDataModifications(project); }); - } - else { - return this.client.del(project.Links.Self).then(function (d) { return _this.notifySubscribersToDataModifications(project); }); - } - }; - ProjectRepository.prototype.markAsStale = function (project) { - return this.client.post(project.Links["RepositoryModified"]); - }; - return ProjectRepository; -}(basicRepository_1.BasicRepository)); -function ShouldUseDefaultBranch(branch) { - return typeof branch === "object"; -} -function GetBranchDetails(branch) { - if (typeof branch === "string" || branch instanceof String) { - return branch; - } - else { - return branch === null || branch === void 0 ? void 0 : branch.Name; - } -} -exports["default"] = ProjectRepository; +//# sourceMappingURL=lifecycleResource.js.map + +/***/ }), +/***/ 55847: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=linksCollection.js.map /***/ }), -/***/ 91795: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 92803: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable @typescript-eslint/no-non-null-assertion,jsdoc/require-param */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/consistent-type-assertions */ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -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); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProjectScopedRepository = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var basicRepository_1 = __nccwpck_require__(30970); -var lodash_1 = __nccwpck_require__(90250); -var ProjectScopedRepository = /** @class */ (function (_super) { - __extends(ProjectScopedRepository, _super); - function ProjectScopedRepository(projectRepository, collectionLinkName, client) { - var _this = _super.call(this, collectionLinkName, client) || this; - _this.takeAll = 2147483647; - _this.projectRepository = projectRepository; - return _this; - } - ProjectScopedRepository.prototype.create = function (resource, args) { - var _this = this; - // Need to separate this out because it's either called immediately, or - var createInternal = function (projectResource, resource, args) { - // For now, we only want to use the project scoped endpoint for version controlled projects - // Database projects should remain as they were - if (projectResource.PersistenceSettings.Type == message_contracts_1.PersistenceSettingsType.VersionControlled) { - return _this.createForProject(projectResource, resource, args); - } - return _super.prototype.create.call(_this, resource, args); - }; - return this.projectRepository.get(resource.ProjectId).then(function (proj) { return createInternal(proj, resource, args); }); - }; - ProjectScopedRepository.prototype.createForProject = function (projectResource, resource, args) { - var _this = this; - var link = projectResource.Links[this.collectionLinkName]; - return this.client.create(link, resource, args).then(function (r) { return _this.notifySubscribersToDataModifications(r); }); - }; - ProjectScopedRepository.prototype.listFromProject = function (projectResource, args) { - var link = projectResource.Links[this.collectionLinkName]; - return this.client.get(link, args); - }; - ProjectScopedRepository.prototype.getFromProject = function (projectResource, id, args) { - if (projectResource.PersistenceSettings.Type == message_contracts_1.PersistenceSettingsType.VersionControlled) { - var allArgs = this.extend(args || {}, { id: id }); - var link = projectResource.Links[this.collectionLinkName]; - return this.client.get(link, allArgs); - } - return _super.prototype.get.call(this, id, args); - }; - ProjectScopedRepository.prototype.allFromProject = function (projectResource, args) { - if (args !== undefined && args.ids instanceof Array && args.ids.length === 0) { - return new Promise(function (res) { - res([]); - }); - } - // http.sys has a max query string of about 16k chars. Our typical max id length is 50 chars - // so if we are doing requests by id and have more than 300, split into multiple requests - var maxIds = 300; - if (args !== undefined && args.ids instanceof Array && args.ids.length > maxIds) { - return this.batchRequestsByIdForProject(projectResource, args, maxIds); - } - var allArgs = this.extend(args || {}, { take: this.takeAll }); - var link = projectResource.Links[this.collectionLinkName]; - return this.client.get(link, allArgs).then(function (res) { return res.Items; }); - }; - ProjectScopedRepository.prototype.saveToProject = function (projectResource, resource, args) { - if (isNewResource(resource)) { - return this.createForProject(projectResource, resource, args); - } - else { - //We need the cast here, since there is a bug in typescript where things don't narrow appropriately for generics https://github.com/microsoft/TypeScript/issues/44404 - //The usual workaround of inverting the checks doesn't seem to work here unfortunately so there is no way to avoid the cast until the bug is fixed. - return this.modify(resource, args); - } - function isTruthy(value) { - return !!value; - } - function isNewResource(resource) { - return !("Id" in resource && isTruthy(resource.Id) && isTruthy(resource.Links)); - } - }; - ProjectScopedRepository.prototype.batchRequestsByIdForProject = function (projectResource, args, batchSize) { - var _this = this; - var idArrays = (0, lodash_1.chunk)(args.ids, batchSize); - var promises = idArrays.map(function (ids) { - var newArgs = __assign(__assign({}, args), { ids: ids }); - var link = projectResource.Links[_this.collectionLinkName]; - return _this.client.get(link, newArgs); - }); - return Promise.all(promises).then(function (result) { return (0, lodash_1.flatten)(result); }); - }; - return ProjectScopedRepository; -}(basicRepository_1.BasicRepository)); -exports.ProjectScopedRepository = ProjectScopedRepository; +//# sourceMappingURL=loginCommand.js.map +/***/ }), + +/***/ 97218: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=loginInitiatedResource.js.map /***/ }), -/***/ 57502: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 54085: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProjectTriggerRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ProjectTriggerRepository = /** @class */ (function (_super) { - __extends(ProjectTriggerRepository, _super); - function ProjectTriggerRepository(client) { - return _super.call(this, "ProjectTriggers", client) || this; - } - return ProjectTriggerRepository; -}(basicRepository_1.BasicRepository)); -exports.ProjectTriggerRepository = ProjectTriggerRepository; +//# sourceMappingURL=loginState.js.map + +/***/ }), + +/***/ 64605: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DeleteMachinesBehavior = void 0; +var DeleteMachinesBehavior; +(function (DeleteMachinesBehavior) { + DeleteMachinesBehavior["DoNotDelete"] = "DoNotDelete"; + DeleteMachinesBehavior["DeleteUnavailableMachines"] = "DeleteUnavailableMachines"; +})(DeleteMachinesBehavior = exports.DeleteMachinesBehavior || (exports.DeleteMachinesBehavior = {})); +//# sourceMappingURL=machineCleanupPolicy.js.map /***/ }), -/***/ 7358: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 95545: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProxyRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ProxyRepository = /** @class */ (function (_super) { - __extends(ProxyRepository, _super); - function ProxyRepository(client) { - return _super.call(this, "Proxies", client) || this; - } - return ProxyRepository; -}(basicRepository_1.BasicRepository)); -exports.ProxyRepository = ProxyRepository; +//# sourceMappingURL=machineConnectionStatus.js.map + +/***/ }), + +/***/ 73927: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MachineConnectivityBehavior = void 0; +var MachineConnectivityBehavior; +(function (MachineConnectivityBehavior) { + MachineConnectivityBehavior["ExpectedToBeOnline"] = "ExpectedToBeOnline"; + MachineConnectivityBehavior["MayBeOfflineAndCanBeSkipped"] = "MayBeOfflineAndCanBeSkipped"; +})(MachineConnectivityBehavior = exports.MachineConnectivityBehavior || (exports.MachineConnectivityBehavior = {})); +//# sourceMappingURL=machineConnectivityPolicy.js.map /***/ }), -/***/ 87252: +/***/ 57636: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -8098,365 +15242,171 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ReleasesRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var ReleasesRepository = /** @class */ (function (_super) { - __extends(ReleasesRepository, _super); - function ReleasesRepository(client) { - return _super.call(this, "Releases", client) || this; +exports.MachineFilterResource = void 0; +var triggerFilterResource_1 = __nccwpck_require__(1033); +var triggerFilterType_1 = __nccwpck_require__(30292); +var MachineFilterResource = (function (_super) { + __extends(MachineFilterResource, _super); + function MachineFilterResource() { + var _this = _super.call(this) || this; + _this.EnvironmentIds = undefined; + _this.Roles = undefined; + _this.EventGroups = undefined; + _this.EventCategories = undefined; + _this.FilterType = triggerFilterType_1.TriggerFilterType.MachineFilter; + return _this; } - ReleasesRepository.prototype.getDeployments = function (release, options) { - return this.client.get(release.Links["Deployments"], options); - }; - ReleasesRepository.prototype.getDeploymentTemplate = function (release) { - return this.client.get(release.Links["DeploymentTemplate"]); - }; - ReleasesRepository.prototype.getDeploymentPreview = function (promotionTarget) { - return this.client.get(promotionTarget.Links["Preview"], { includeDisabledSteps: true }); - }; - ReleasesRepository.prototype.progression = function (release) { - return this.client.get(release.Links["Progression"]); - }; - ReleasesRepository.prototype.snapshotVariables = function (release) { - return this.client.post(release.Links["SnapshotVariables"]); - }; - ReleasesRepository.prototype.deploymentPreviews = function (release, deploymentTemplates) { - return this.client.post(release.Links["DeploymentPreviews"], deploymentTemplates); - }; - ReleasesRepository.prototype.getChannel = function (release) { - return this.client.get(release.Links["Channel"]); - }; - ReleasesRepository.prototype.getLifecycle = function (release) { - return this.client.get(release.Links["Lifecycle"]); - }; - return ReleasesRepository; -}(basicRepository_1.BasicRepository)); -exports.ReleasesRepository = ReleasesRepository; - + return MachineFilterResource; +}(triggerFilterResource_1.TriggerFilterResource)); +exports.MachineFilterResource = MachineFilterResource; +//# sourceMappingURL=machineFilterResource.js.map /***/ }), -/***/ 11050: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 93176: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RetentionDefaultConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var RetentionDefaultConfigurationRepository = /** @class */ (function (_super) { - __extends(RetentionDefaultConfigurationRepository, _super); - function RetentionDefaultConfigurationRepository(client) { - return _super.call(this, "RetentionDefaultConfiguration", client) || this; - } - return RetentionDefaultConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.RetentionDefaultConfigurationRepository = RetentionDefaultConfigurationRepository; +exports.HealthCheckType = void 0; +var HealthCheckType; +(function (HealthCheckType) { + HealthCheckType["RunScript"] = "RunScript"; + HealthCheckType["OnlyConnectivity"] = "OnlyConnectivity"; +})(HealthCheckType = exports.HealthCheckType || (exports.HealthCheckType = {})); +//# sourceMappingURL=machineHealthCheckPolicy.js.map + +/***/ }), + +/***/ 72150: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=machinePolicyResource.js.map /***/ }), -/***/ 82404: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 82705: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookProcessRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var RunbookProcessRepository = /** @class */ (function (_super) { - __extends(RunbookProcessRepository, _super); - function RunbookProcessRepository(client) { - return _super.call(this, "RunbookProcesses", client) || this; - } - RunbookProcessRepository.prototype.getRunbookSnapshotTemplate = function (runbookProcess, runbookSnapshotId) { - return this.client.get(runbookProcess.Links["RunbookSnapshotTemplate"], { runbookSnapshotId: runbookSnapshotId }); +exports.MachineModelHealthStatus = exports.NewMachine = void 0; +function NewMachine(name, endpoint) { + return { + IsDisabled: false, + IsInProcess: false, + Endpoint: endpoint, + HealthStatus: MachineModelHealthStatus.Unknown, + Name: name, + HasLatestCalamari: false, + MachinePolicyId: "", }; - return RunbookProcessRepository; -}(basicRepository_1.BasicRepository)); -exports.RunbookProcessRepository = RunbookProcessRepository; - +} +exports.NewMachine = NewMachine; +var MachineModelHealthStatus; +(function (MachineModelHealthStatus) { + MachineModelHealthStatus["Healthy"] = "Healthy"; + MachineModelHealthStatus["Unavailable"] = "Unavailable"; + MachineModelHealthStatus["Unknown"] = "Unknown"; + MachineModelHealthStatus["HasWarnings"] = "HasWarnings"; + MachineModelHealthStatus["Unhealthy"] = "Unhealthy"; +})(MachineModelHealthStatus = exports.MachineModelHealthStatus || (exports.MachineModelHealthStatus = {})); +//# sourceMappingURL=machineResource.js.map /***/ }), -/***/ 18312: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 59827: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookRepository = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var semver_1 = __nccwpck_require__(11383); -var basicRepository_1 = __nccwpck_require__(30970); -var RunbookRepository = /** @class */ (function (_super) { - __extends(RunbookRepository, _super); - function RunbookRepository(client) { - var _this = _super.call(this, "Runbooks", client) || this; - _this.integrationTestVersion = new semver_1.SemVer("0.0.0-local"); - _this.versionAfterWhichRunbookRunParametersAreAvailable = new semver_1.SemVer("2020.3.1"); - return _this; - } - RunbookRepository.prototype.find = function (nameOrId, project) { - return __awaiter(this, void 0, void 0, function () { - var _a, runbooks; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (nameOrId.length === 0) - return [2 /*return*/]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.get(nameOrId)]; - case 2: return [2 /*return*/, _b.sent()]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: return [4 /*yield*/, this.list({ - partialName: nameOrId, - projectIds: [project.Id] - })]; - case 5: - runbooks = _b.sent(); - return [2 /*return*/, runbooks.Items.find(function (r) { return r.Name === nameOrId; })]; - } - }); - }); - }; - RunbookRepository.prototype.getRunbookEnvironments = function (runbook) { - return this.client.get(runbook.Links["RunbookEnvironments"]); - }; - RunbookRepository.prototype.getRunbookRunPreview = function (promotionTarget) { - return this.client.get(promotionTarget.Links["RunbookRunPreview"], { includeDisabledSteps: true }); - }; - RunbookRepository.prototype.getRunbookRunTemplate = function (runbook) { - return this.client.get(runbook.Links["RunbookRunTemplate"]); - }; - RunbookRepository.prototype.getRunbookSnapshots = function (runbook, args) { - return this.client.get(runbook.Links["RunbookSnapshots"], args); - }; - RunbookRepository.prototype.getRunbookSnapshotTemplate = function (runbook) { - return this.client.get(runbook.Links["RunbookSnapshotTemplate"]); - }; - RunbookRepository.prototype.run = function (runbook, runbookRun) { - return __awaiter(this, void 0, void 0, function () { - var supportsRunbookRunParameters, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - supportsRunbookRunParameters = this.serverSupportsRunbookRunParameters(this.client.getServerInformation().version); - if (!supportsRunbookRunParameters) return [3 /*break*/, 2]; - return [4 /*yield*/, this.runWithParameters(runbook, message_contracts_1.RunbookRunParameters.MapFrom(runbookRun))]; - case 1: - _a = (_b.sent())[0]; - return [3 /*break*/, 4]; - case 2: return [4 /*yield*/, this.client.post(runbook.Links["CreateRunbookRun"], runbookRun)]; - case 3: - _a = _b.sent(); - _b.label = 4; - case 4: return [2 /*return*/, _a]; - } - }); - }); - }; - RunbookRepository.prototype.runWithParameters = function (runbook, runbookRunParameters) { - return __awaiter(this, void 0, void 0, function () { - var serverVersion, serverSupportsRunbookRunParameters; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - serverVersion = this.client.getServerInformation().version; - serverSupportsRunbookRunParameters = this.serverSupportsRunbookRunParameters(serverVersion); - if (!serverSupportsRunbookRunParameters) - throw new Error("This Octopus Deploy server is an older version ".concat(serverVersion, " that does not yet support RunbookRunParameters. Please update your Octopus Deploy server to 2020.3.* or newer to access this feature.")); - return [4 /*yield*/, this.client.post(runbook.Links["CreateRunbookRun"], runbookRunParameters)]; - case 1: return [2 /*return*/, _a.sent()]; - } - }); - }); - }; - RunbookRepository.prototype.serverSupportsRunbookRunParameters = function (version) { - var serverVersion = new semver_1.SemVer(version); - // note: ensure the server version is >= *any* 2020.3.1 - return serverVersion >= this.versionAfterWhichRunbookRunParametersAreAvailable || serverVersion == this.integrationTestVersion; - }; - return RunbookRepository; -}(basicRepository_1.BasicRepository)); -exports.RunbookRepository = RunbookRepository; +//# sourceMappingURL=machineScriptPolicy.js.map + +/***/ }), + +/***/ 42463: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TentacleUpdateBehavior = exports.CalamariUpdateBehavior = void 0; +var CalamariUpdateBehavior; +(function (CalamariUpdateBehavior) { + CalamariUpdateBehavior["UpdateOnDeployment"] = "UpdateOnDeployment"; + CalamariUpdateBehavior["UpdateOnNewMachine"] = "UpdateOnNewMachine"; + CalamariUpdateBehavior["UpdateAlways"] = "UpdateAlways"; +})(CalamariUpdateBehavior = exports.CalamariUpdateBehavior || (exports.CalamariUpdateBehavior = {})); +var TentacleUpdateBehavior; +(function (TentacleUpdateBehavior) { + TentacleUpdateBehavior["NeverUpdate"] = "NeverUpdate"; + TentacleUpdateBehavior["Update"] = "Update"; +})(TentacleUpdateBehavior = exports.TentacleUpdateBehavior || (exports.TentacleUpdateBehavior = {})); +//# sourceMappingURL=machineUpdatePolicy.js.map /***/ }), -/***/ 30242: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 51865: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookRunRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var RunbookRunRepository = /** @class */ (function (_super) { - __extends(RunbookRunRepository, _super); - function RunbookRunRepository(client) { - return _super.call(this, "RunbookRuns", client) || this; - } - return RunbookRunRepository; -}(basicRepository_1.BasicRepository)); -exports.RunbookRunRepository = RunbookRunRepository; +//# sourceMappingURL=maintenanceConfigurationResource.js.map +/***/ }), + +/***/ 52939: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=multiTenancyStatusResource.js.map /***/ }), -/***/ 73544: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 22110: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookSnapshotRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var RunbookSnapshotRepository = /** @class */ (function (_super) { - __extends(RunbookSnapshotRepository, _super); - function RunbookSnapshotRepository(client) { - return _super.call(this, "RunbookSnapshots", client) || this; - } - RunbookSnapshotRepository.prototype.getRunbookRunPreviewForPromotionTarget = function (promotionTarget) { - return this.client.get(promotionTarget.Links["RunbookRunPreview"], { includeDisabledSteps: true }); - }; - RunbookSnapshotRepository.prototype.getRunbookRuns = function (runbookSnapshot, options) { - return this.client.get(runbookSnapshot.Links["RunbookRuns"], options); - }; - RunbookSnapshotRepository.prototype.getRunbookRunTemplate = function (runbookSnapshot) { - return this.client.get(runbookSnapshot.Links["RunbookRunTemplate"]); - }; - RunbookSnapshotRepository.prototype.snapshotVariables = function (runbookSnapshot) { - return this.client.post(runbookSnapshot.Links["SnapshotVariables"]); - }; - return RunbookSnapshotRepository; -}(basicRepository_1.BasicRepository)); -exports.RunbookSnapshotRepository = RunbookSnapshotRepository; +//# sourceMappingURL=namedReferenceItem.js.map + +/***/ }), + +/***/ 65688: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=namedResource.js.map /***/ }), -/***/ 63767: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 72151: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=nonVcsRunbookResource.js.map + +/***/ }), + +/***/ 48920: +/***/ (function(__unused_webpack_module, exports) { "use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any */ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || @@ -8484,29944 +15434,34775 @@ var __assign = (this && this.__assign) || function () { return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SchedulerRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var SchedulerRepository = /** @class */ (function (_super) { - __extends(SchedulerRepository, _super); - function SchedulerRepository(client) { - return _super.call(this, "Scheduler", client) || this; +exports.OctopusError = void 0; +var OctopusError = (function (_super) { + __extends(OctopusError, _super); + function OctopusError(StatusCode, message) { + var _this = _super.call(this, message) || this; + _this.StatusCode = StatusCode; + _this.ErrorMessage = message; + _this.Errors = []; + Object.setPrototypeOf(_this, OctopusError.prototype); + return _this; } - SchedulerRepository.prototype.getDetails = function (name, options) { - var args = __assign(__assign({}, options), { name: name }); - return this.client.get(this.client.getLink("Scheduler"), args); + OctopusError.create = function (statusCode, response) { + var e = new OctopusError(statusCode); + var n = __assign(__assign({}, e), response); + Object.setPrototypeOf(n, OctopusError.prototype); + return n; }; - return SchedulerRepository; -}(basicRepository_1.BasicRepository)); -exports.SchedulerRepository = SchedulerRepository; + return OctopusError; +}(Error)); +exports.OctopusError = OctopusError; +//# sourceMappingURL=octopusError.js.map + +/***/ }), + +/***/ 84328: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=octopusProjectFeedResource.js.map /***/ }), -/***/ 18774: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 58858: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ScopedUserRoleRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var ScopedUserRoleRepository = /** @class */ (function (_super) { - __extends(ScopedUserRoleRepository, _super); - function ScopedUserRoleRepository(client) { - return _super.call(this, "ScopedUserRoles", client) || this; - } - return ScopedUserRoleRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.ScopedUserRoleRepository = ScopedUserRoleRepository; +//# sourceMappingURL=octopusServerClusterSummaryResource.js.map + +/***/ }), + +/***/ 81935: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=octopusServerNodeDetailsResource.js.map /***/ }), -/***/ 96489: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 81286: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=octopusServerNodeResource.js.map + +/***/ }), + +/***/ 12358: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=octopusServerNodeSummaryResource.js.map + +/***/ }), + +/***/ 14239: +/***/ (function(__unused_webpack_module, exports) { + +"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); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ServerConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var ServerConfigurationRepository = /** @class */ (function (_super) { - __extends(ServerConfigurationRepository, _super); - function ServerConfigurationRepository(client) { - return _super.call(this, "ServerConfiguration", client) || this; - } - ServerConfigurationRepository.prototype.settings = function () { - return this.client.get(this.client.getLink("ServerConfigurationSettings")); +exports.createWarningsFromOctopusWarning = void 0; +function createWarningsFromOctopusWarning(warning) { + return { + message: warning.WarningMessage, + warnings: warning.Warnings || [], + parsedHelpLinks: warning.ParsedHelpLinks, + helpLink: warning.HelpLink, + helpText: warning.HelpText, + fieldWarnings: {}, + details: flattenWarningDetails(warning.Details), }; - return ServerConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.ServerConfigurationRepository = ServerConfigurationRepository; +} +exports.createWarningsFromOctopusWarning = createWarningsFromOctopusWarning; +function joinWarningEntries(parentKey, entry) { + if (entry === void 0) { entry = {}; } + return Object.keys(entry).reduce(function (prev, key) { + var _a; + return (__assign(__assign({}, prev), (_a = {}, _a["".concat(parentKey, ":").concat(key)] = entry[key].join(", "), _a))); + }, {}); +} +function flattenWarningDetails(details) { + if (details === void 0) { details = {}; } + return Object.keys(details).reduce(function (prev, parentKey) { return (__assign(__assign({}, prev), joinWarningEntries(parentKey, details[parentKey]))); }, {}); +} +//# sourceMappingURL=octopusValidationResponse.js.map + +/***/ }), + +/***/ 17929: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=offlineDropDestinationResource.js.map + +/***/ }), + +/***/ 2847: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.OfflineDropDestinationType = void 0; +var OfflineDropDestinationType; +(function (OfflineDropDestinationType) { + OfflineDropDestinationType["Artifact"] = "Artifact"; + OfflineDropDestinationType["FileSystem"] = "FileSystem"; +})(OfflineDropDestinationType = exports.OfflineDropDestinationType || (exports.OfflineDropDestinationType = {})); +//# sourceMappingURL=offlineDropDestinationType.js.map + +/***/ }), + +/***/ 50671: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=onboardingResource.js.map + +/***/ }), + +/***/ 37648: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageAcquisitionLocation = void 0; +var PackageAcquisitionLocation; +(function (PackageAcquisitionLocation) { + PackageAcquisitionLocation["Server"] = "Server"; + PackageAcquisitionLocation["ExecutionTarget"] = "ExecutionTarget"; + PackageAcquisitionLocation["NotAcquired"] = "NotAcquired"; +})(PackageAcquisitionLocation = exports.PackageAcquisitionLocation || (exports.PackageAcquisitionLocation = {})); +//# sourceMappingURL=packageAcquisitionLocation.js.map + +/***/ }), + +/***/ 35882: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=packageDescriptionResource.js.map + +/***/ }), + +/***/ 89010: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=packageFromBuiltInFeedResource.js.map + +/***/ }), + +/***/ 66933: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PackageSelectionMode = void 0; +var PackageSelectionMode; +(function (PackageSelectionMode) { + PackageSelectionMode["Immediate"] = "immediate"; + PackageSelectionMode["Deferred"] = "deferred"; +})(PackageSelectionMode = exports.PackageSelectionMode || (exports.PackageSelectionMode = {})); +//# sourceMappingURL=packageReference.js.map + +/***/ }), + +/***/ 20928: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=packageResource.js.map + +/***/ }), + +/***/ 79856: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=packageVersionResource.js.map + +/***/ }), + +/***/ 15259: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=pagingCollection.js.map + +/***/ }), + +/***/ 60651: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DashboardRenderMode = void 0; +var DashboardRenderMode; +(function (DashboardRenderMode) { + DashboardRenderMode["VirtualizeColumns"] = "VirtualizeColumns"; + DashboardRenderMode["VirtualizeRowsAndColumns"] = "VirtualizeRowsAndColumns"; +})(DashboardRenderMode = exports.DashboardRenderMode || (exports.DashboardRenderMode = {})); +//# sourceMappingURL=performanceConfigurationResource.js.map + +/***/ }), + +/***/ 49346: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Permission = void 0; +var Permission; +(function (Permission) { + Permission["None"] = "None"; + Permission["AccountCreate"] = "AccountCreate"; + Permission["AccountDelete"] = "AccountDelete"; + Permission["AccountEdit"] = "AccountEdit"; + Permission["AccountView"] = "AccountView"; + Permission["ActionTemplateCreate"] = "ActionTemplateCreate"; + Permission["ActionTemplateDelete"] = "ActionTemplateDelete"; + Permission["ActionTemplateEdit"] = "ActionTemplateEdit"; + Permission["ActionTemplateView"] = "ActionTemplateView"; + Permission["AdministerSystem"] = "AdministerSystem"; + Permission["ArtifactCreate"] = "ArtifactCreate"; + Permission["ArtifactDelete"] = "ArtifactDelete"; + Permission["ArtifactEdit"] = "ArtifactEdit"; + Permission["ArtifactView"] = "ArtifactView"; + Permission["BuildInformationAdminister"] = "BuildInformationAdminister"; + Permission["BuildInformationPush"] = "BuildInformationPush"; + Permission["BuiltInFeedAdminister"] = "BuiltInFeedAdminister"; + Permission["BuiltInFeedDownload"] = "BuiltInFeedDownload"; + Permission["BuiltInFeedPush"] = "BuiltInFeedPush"; + Permission["CertificateCreate"] = "CertificateCreate"; + Permission["CertificateDelete"] = "CertificateDelete"; + Permission["CertificateEdit"] = "CertificateEdit"; + Permission["CertificateView"] = "CertificateView"; + Permission["CertificateExportPrivateKey"] = "CertificateExportPrivateKey"; + Permission["ConfigureServer"] = "ConfigureServer"; + Permission["DefectReport"] = "DefectReport"; + Permission["DefectResolve"] = "DefectResolve"; + Permission["DeploymentCreate"] = "DeploymentCreate"; + Permission["DeploymentDelete"] = "DeploymentDelete"; + Permission["DeploymentView"] = "DeploymentView"; + Permission["EnvironmentCreate"] = "EnvironmentCreate"; + Permission["EnvironmentDelete"] = "EnvironmentDelete"; + Permission["EnvironmentEdit"] = "EnvironmentEdit"; + Permission["EnvironmentView"] = "EnvironmentView"; + Permission["EventView"] = "EventView"; + Permission["FeedEdit"] = "FeedEdit"; + Permission["FeedView"] = "FeedView"; + Permission["InterruptionSubmit"] = "InterruptionSubmit"; + Permission["InterruptionView"] = "InterruptionView"; + Permission["InterruptionViewSubmitResponsible"] = "InterruptionViewSubmitResponsible"; + Permission["LibraryVariableSetCreate"] = "LibraryVariableSetCreate"; + Permission["LibraryVariableSetDelete"] = "LibraryVariableSetDelete"; + Permission["LibraryVariableSetEdit"] = "LibraryVariableSetEdit"; + Permission["LibraryVariableSetView"] = "LibraryVariableSetView"; + Permission["LifecycleCreate"] = "LifecycleCreate"; + Permission["LifecycleDelete"] = "LifecycleDelete"; + Permission["LifecycleEdit"] = "LifecycleEdit"; + Permission["LifecycleView"] = "LifecycleView"; + Permission["ReleaseCreate"] = "ReleaseCreate"; + Permission["ReleaseView"] = "ReleaseView"; + Permission["ReleaseEdit"] = "ReleaseEdit"; + Permission["ReleaseDelete"] = "ReleaseDelete"; + Permission["MachineCreate"] = "MachineCreate"; + Permission["MachineEdit"] = "MachineEdit"; + Permission["MachineView"] = "MachineView"; + Permission["MachineDelete"] = "MachineDelete"; + Permission["MachinePolicyCreate"] = "MachinePolicyCreate"; + Permission["MachinePolicyDelete"] = "MachinePolicyDelete"; + Permission["MachinePolicyEdit"] = "MachinePolicyEdit"; + Permission["MachinePolicyView"] = "MachinePolicyView"; + Permission["ProjectGroupCreate"] = "ProjectGroupCreate"; + Permission["ProjectGroupDelete"] = "ProjectGroupDelete"; + Permission["ProjectGroupEdit"] = "ProjectGroupEdit"; + Permission["ProjectGroupView"] = "ProjectGroupView"; + Permission["TenantCreate"] = "TenantCreate"; + Permission["TenantDelete"] = "TenantDelete"; + Permission["TenantEdit"] = "TenantEdit"; + Permission["TenantView"] = "TenantView"; + Permission["TagSetCreate"] = "TagSetCreate"; + Permission["TagSetDelete"] = "TagSetDelete"; + Permission["TagSetEdit"] = "TagSetEdit"; + Permission["ProcessEdit"] = "ProcessEdit"; + Permission["ProcessView"] = "ProcessView"; + Permission["ProjectCreate"] = "ProjectCreate"; + Permission["ProjectDelete"] = "ProjectDelete"; + Permission["ProjectEdit"] = "ProjectEdit"; + Permission["ProjectView"] = "ProjectView"; + Permission["ProxyCreate"] = "ProxyCreate"; + Permission["ProxyDelete"] = "ProxyDelete"; + Permission["ProxyEdit"] = "ProxyEdit"; + Permission["ProxyView"] = "ProxyView"; + Permission["RunbookEdit"] = "RunbookEdit"; + Permission["RunbookView"] = "RunbookView"; + Permission["RunbookRunCreate"] = "RunbookRunCreate"; + Permission["RunbookRunEdit"] = "RunbookRunEdit"; + Permission["RunbookRunView"] = "RunbookRunView"; + Permission["SpaceCreate"] = "SpaceCreate"; + Permission["SpaceDelete"] = "SpaceDelete"; + Permission["SpaceEdit"] = "SpaceEdit"; + Permission["SpaceView"] = "SpaceView"; + Permission["SubscriptionCreate"] = "SubscriptionCreate"; + Permission["SubscriptionDelete"] = "SubscriptionDelete"; + Permission["SubscriptionEdit"] = "SubscriptionEdit"; + Permission["SubscriptionView"] = "SubscriptionView"; + Permission["TaskCancel"] = "TaskCancel"; + Permission["TaskCreate"] = "TaskCreate"; + Permission["TaskEdit"] = "TaskEdit"; + Permission["TaskView"] = "TaskView"; + Permission["TeamCreate"] = "TeamCreate"; + Permission["TeamDelete"] = "TeamDelete"; + Permission["TeamEdit"] = "TeamEdit"; + Permission["TeamView"] = "TeamView"; + Permission["TriggerCreate"] = "TriggerCreate"; + Permission["TriggerDelete"] = "TriggerDelete"; + Permission["TriggerEdit"] = "TriggerEdit"; + Permission["TriggerView"] = "TriggerView"; + Permission["UserEdit"] = "UserEdit"; + Permission["UserInvite"] = "UserInvite"; + Permission["UserView"] = "UserView"; + Permission["UserRoleEdit"] = "UserRoleEdit"; + Permission["UserRoleView"] = "UserRoleView"; + Permission["VariableEdit"] = "VariableEdit"; + Permission["VariableEditUnscoped"] = "VariableEditUnscoped"; + Permission["VariableView"] = "VariableView"; + Permission["VariableViewUnscoped"] = "VariableViewUnscoped"; + Permission["WorkerEdit"] = "WorkerEdit"; + Permission["WorkerView"] = "WorkerView"; +})(Permission = exports.Permission || (exports.Permission = {})); +//# sourceMappingURL=permission.js.map + +/***/ }), + +/***/ 54710: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=permissionDescriptions.js.map + +/***/ }), + +/***/ 81148: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=phaseResource.js.map + +/***/ }), + +/***/ 32771: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProcessTypeAliasMap = exports.ProcessType = void 0; +var ProcessType; +(function (ProcessType) { + ProcessType["Deployment"] = "Deployment"; + ProcessType["Runbook"] = "Runbook"; +})(ProcessType = exports.ProcessType || (exports.ProcessType = {})); +exports.ProcessTypeAliasMap = (_a = {}, + _a[ProcessType.Deployment] = { + alias: { + noun: "deployment", + verb: "deploy", + plural: "deployments", + pastTense: "deployed", + preposition: "to", + }, + manifest: "Release", + }, + _a[ProcessType.Runbook] = { + alias: { + noun: "runbook", + verb: "run", + plural: "runs", + pastTense: "ran", + preposition: "on", + }, + manifest: "Snapshot", + }, + _a); +//# sourceMappingURL=processType.js.map + +/***/ }), + +/***/ 29703: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=progressionResource.js.map /***/ }), -/***/ 84463: +/***/ 47875: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ServerStatusRepository = void 0; -var ServerStatusRepository = /** @class */ (function () { - function ServerStatusRepository(client) { - this.client = client; - } - ServerStatusRepository.prototype.getServerStatus = function () { - return this.client.get(this.client.getLink("ServerStatus")); - }; - ServerStatusRepository.prototype.getLogs = function (status, args) { - return this.client.get(status.Links["RecentLogs"], args); - }; - ServerStatusRepository.prototype.getHealth = function (status) { - return this.client.get(status.Links["Health"]); - }; - ServerStatusRepository.prototype.getSystemInfo = function (status) { - return this.client.get(status.Links["SystemInfo"]); - }; - ServerStatusRepository.prototype.gcCollect = function (status) { - return this.client.post(status.Links["GCCollect"], status); - }; - ServerStatusRepository.prototype.getDocumentCounts = function (status) { - return this.client.get(status.Links["DocumentCounts"]); - }; - ServerStatusRepository.prototype.getExtensionStats = function () { - return this.client.get(this.client.getLink("ExtensionStats")); - }; - ServerStatusRepository.prototype.getTimezones = function () { - return this.client.get(this.client.getLink("Timezones")); - }; - return ServerStatusRepository; -}()); -exports.ServerStatusRepository = ServerStatusRepository; - +//# sourceMappingURL=projectExportRequest.js.map /***/ }), -/***/ 50924: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 62054: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any */ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var SettingsRepository = /** @class */ (function (_super) { - __extends(SettingsRepository, _super); - function SettingsRepository(client) { - return _super.call(this, "Configuration", client) || this; - } - SettingsRepository.prototype.getById = function (id) { - return this.client.get(this.client.getLink("Configuration"), { id: id }); - }; - SettingsRepository.prototype.getValues = function (resource) { - return this.client.get(resource.Links["Values"]); - }; - SettingsRepository.prototype.getMetadata = function (resource) { - return this.client.get(resource.Links["Metadata"]); - }; - SettingsRepository.prototype.saveValues = function (metadataResource, resource) { - return this.client.put(metadataResource.Links["Values"], resource); - }; - return SettingsRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = SettingsRepository; - +//# sourceMappingURL=projectExportResponse.js.map /***/ }), -/***/ 7025: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 29029: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SmtpConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var SmtpConfigurationRepository = /** @class */ (function (_super) { - __extends(SmtpConfigurationRepository, _super); - function SmtpConfigurationRepository(client) { - return _super.call(this, "SmtpConfiguration", client) || this; - } - SmtpConfigurationRepository.prototype.IsConfigured = function () { - return this.client.get(this.client.getLink("SmtpIsConfigured")); - }; - return SmtpConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.SmtpConfigurationRepository = SmtpConfigurationRepository; - +//# sourceMappingURL=projectGroupResource.js.map /***/ }), -/***/ 56836: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 95699: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpaceRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var SpaceRepository = /** @class */ (function (_super) { - __extends(SpaceRepository, _super); - function SpaceRepository(client) { - return _super.call(this, "Spaces", client) || this; - } - SpaceRepository.prototype.search = function (keyword) { - return this.client.get(this.client.getLink("SpaceSearch"), { id: this.client.spaceId, keyword: keyword }); - }; - return SpaceRepository; -}(basicRepository_1.BasicRepository)); -exports.SpaceRepository = SpaceRepository; - +//# sourceMappingURL=projectImportFile.js.map /***/ }), -/***/ 94178: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 55795: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var SubscriptionRepository = /** @class */ (function (_super) { - __extends(SubscriptionRepository, _super); - function SubscriptionRepository(client) { - return _super.call(this, "Subscriptions", client) || this; - } - return SubscriptionRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = SubscriptionRepository; - +//# sourceMappingURL=projectImportFileListResponse.js.map /***/ }), -/***/ 50450: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 24196: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var TagSetRepository = /** @class */ (function (_super) { - __extends(TagSetRepository, _super); - function TagSetRepository(client) { - return _super.call(this, "TagSets", client) || this; - } - TagSetRepository.prototype.sort = function (ids) { - return this.client.put(this.client.getLink("TagSetSortOrder"), ids); - }; - return TagSetRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = TagSetRepository; +//# sourceMappingURL=projectImportPreviewRequest.js.map + +/***/ }), + +/***/ 86630: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=projectImportPreviewResponse.js.map /***/ }), -/***/ 53573: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 70634: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -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); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TaskRepository = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var lodash_1 = __nccwpck_require__(90250); -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var TaskRepository = /** @class */ (function (_super) { - __extends(TaskRepository, _super); - function TaskRepository(client) { - return _super.call(this, "Tasks", client) || this; - } - TaskRepository.prototype.createPerformIntegrityCheckTask = function () { - return this.createSystemTask(message_contracts_1.TaskName.SystemIntegrityCheck, "Check System Integrity", {}); - }; - TaskRepository.prototype.createSynchronizeCommunityStepTemplatesTask = function () { - return this.createSystemTask(message_contracts_1.TaskName.SyncCommunityActionTemplates, "Synchronize Community Step Templates", {}); - }; - TaskRepository.prototype.createConfigureLetsEncryptTask = function (letsEncryptArguments) { - return this.createSystemTask(message_contracts_1.TaskName.ConfigureLetsEncrypt, "Configure Let's Encrypt SSL Certificate", letsEncryptArguments); - }; - TaskRepository.prototype.createRenewLetsEncryptTask = function (letsEncryptArguments) { - return this.createSystemTask(message_contracts_1.TaskName.ConfigureLetsEncrypt, "Renew Let's Encrypt SSL Certificate", letsEncryptArguments); - }; - TaskRepository.prototype.createSendTestEmailTask = function (emailAddress) { - return this.createSystemTask(message_contracts_1.TaskName.TestEmail, "Send test email", { EmailAddress: emailAddress }); - }; - TaskRepository.prototype.createUpgradeTentaclesTask = function () { - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacles", {}); - }; - TaskRepository.prototype.createUpgradeTentaclesTaskForEnvironment = function (environment, machineIds) { - var description = environment ? "Upgrade Tentacles in ".concat(environment.Name) : "Upgrade Tentacles"; - var upgradeTaskArguments = __assign({ RestrictedTo: message_contracts_1.TaskRestrictedTo.DeploymentTargets, MachineIds: machineIds }, (environment ? { EnvironmentId: environment.Id } : {})); - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, description, upgradeTaskArguments); - }; - TaskRepository.prototype.createUpgradeTentacleOnMachineTask = function (machine) { - if (machine.Id !== null && machine.Id !== undefined) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacle on ".concat(machine.Name), { MachineIds: [machine.Id] }); - } - }; - TaskRepository.prototype.createUpgradeTentacleOnWorkerPoolTask = function (workerPool, machineIds) { - var description = workerPool ? "Upgrade Tentacles in ".concat(workerPool.Name) : "Upgrade Tentacles"; - var upgradeTaskArguments = __assign({ RestrictedTo: message_contracts_1.TaskRestrictedTo.Workers, MachineIds: machineIds }, (workerPool ? { WorkerPoolId: workerPool.Id } : {})); - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, description, upgradeTaskArguments); - }; - TaskRepository.prototype.createUpgradeTentaclesTaskRestrictedTo = function (restrictedTo, MachineIds) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.Upgrade, "Upgrade Tentacles", { RestrictedTo: restrictedTo, MachineIds: MachineIds }); - }; - TaskRepository.prototype.createPerformHealthCheckTaskForEnvironment = function (environment, machineIds) { - var description = environment ? "Check deployment target health in ".concat(environment.Name) : "Check deployment target health"; - var healthCheckArguments = __assign({ Timeout: "00:05:00", OnlyTestConnection: false, RestrictedTo: message_contracts_1.TaskRestrictedTo.DeploymentTargets, MachineIds: machineIds }, (environment ? { EnvironmentId: environment.Id } : {})); - return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, healthCheckArguments); - }; - TaskRepository.prototype.createPerformHealthCheckTaskForWorkerPool = function (workerPool, machineIds) { - var description = workerPool ? "Check worker health in ".concat(workerPool.Name) : "Check worker health"; - var healthCheckArguments = __assign({ Timeout: "00:05:00", OnlyTestConnection: false, RestrictedTo: message_contracts_1.TaskRestrictedTo.Workers, MachineIds: machineIds }, (workerPool ? { WorkerPoolId: workerPool.Id } : {})); - return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, healthCheckArguments); - }; - TaskRepository.prototype.createHealthCheckTaskForMachine = function (machine) { - if (machine.Id !== null && machine.Id !== undefined) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, "Check ".concat(machine.Name, " health"), { - Timeout: "00:05:00", - MachineIds: [machine.Id], - OnlyTestConnection: false, - }); - } - }; - TaskRepository.prototype.createHealthCheckTaskRestrictedTo = function (restrictedTo, machineIds) { - var description = restrictedTo === message_contracts_1.TaskRestrictedTo.Workers ? "Check worker health" : "Check deployment target health"; - return this.createSpaceScopedTask(message_contracts_1.TaskName.Health, description, { - Timeout: "00:05:00", - OnlyTestConnection: false, - RestrictedTo: restrictedTo, - MachineIds: machineIds, - }); - }; - TaskRepository.prototype.createUpdateCalamariOnTargetsTask = function (deploymentTargetIds) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Update Calamari on Deployment Targets", { MachineIds: deploymentTargetIds }); - }; - TaskRepository.prototype.createUpdateCalamariOnWorkersTask = function (workerIds) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Upgrade Calamari on Workers", { MachineIds: workerIds }); - }; - TaskRepository.prototype.createUpdateCalamariOnTargetTask = function (machine) { - if (machine.Id !== null && machine.Id !== undefined) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.UpdateCalamari, "Update Calamari on ".concat(machine.Name), { MachineIds: [machine.Id] }); - } - }; - TaskRepository.prototype.createSynchronizeBuiltInPackageRepositoryTask = function () { - return this.createSpaceScopedTask(message_contracts_1.TaskName.SynchronizeBuiltInPackageRepositoryIndex, "Re-index built-in package repository", {}); - }; - TaskRepository.prototype.createTestAzureAccountTask = function (azureAccountId) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Azure account", { AccountId: azureAccountId }); - }; - TaskRepository.prototype.createTestAwsAccountTask = function (awsAccountId) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Amazon Web Services account", { AccountId: awsAccountId }); - }; - TaskRepository.prototype.createTestGoogleCloudAccountTask = function (googleCloudAccountId) { - return this.createSpaceScopedTask(message_contracts_1.TaskName.TestAccount, "Test Google Cloud account", { AccountId: googleCloudAccountId }); - }; - TaskRepository.prototype.createRunActionTemplateTask = function (targets, properties, template) { - var runActionTemplateArguments = __assign(__assign({}, targets), { Properties: properties, ActionTemplateId: template.Id }); - return this.createSpaceScopedTask(message_contracts_1.TaskName.AdHocScript, "Run step template: " + template.Name, runActionTemplateArguments); - }; - TaskRepository.prototype.createScriptConsoleTask = function (targets, syntax, scriptBody) { - var scriptConsoleArguments = __assign(__assign({}, targets), { Syntax: syntax, ScriptBody: scriptBody }); - return this.createSpaceScopedTask(message_contracts_1.TaskName.AdHocScript, "Script run from management console", scriptConsoleArguments); - }; - TaskRepository.prototype.create = function (resource, args) { - throw new Error("Can't create generic tasks. Instead, concrete task factory methods on the TaskRepository should be used to create tasks"); - }; - TaskRepository.prototype.details = function (task, args) { - return this.client.get(task.Links["Details"], args); - }; - TaskRepository.prototype.getQueuedBehind = function (task, args) { - var combinedParameters = this.extend(this.spacePartitionParameters(), args); - return this.client.get(task.Links["QueuedBehind"], combinedParameters); - }; - TaskRepository.prototype.getRaw = function (task) { - return this.client.getRaw(task.Links["Raw"]); - }; - TaskRepository.prototype.taskTypes = function () { - return this.client.get(this.client.getLink("TaskTypes"), {}); - }; - TaskRepository.prototype.filter = function (args) { - var combinedParameters = this.extend(this.spacePartitionParameters(), args); - return this.client.get(this.client.getLink("Tasks"), combinedParameters); - }; - TaskRepository.prototype.rerun = function (task) { - return this.client.post(task.Links["Rerun"]); - }; - TaskRepository.prototype.cancel = function (task) { - return this.client.post(task.Links["Cancel"]); - }; - TaskRepository.prototype.changeState = function (task, state, reason) { - return this.client.post(task.Links["State"], { state: state, reason: reason }); - }; - TaskRepository.prototype.list = function (args) { - return _super.prototype.list.call(this, args); - }; - TaskRepository.prototype.byIds = function (ids) { - var _this = this; - var batchSize = 300; - var idArrays = (0, lodash_1.chunk)(ids, batchSize); - var promises = idArrays.map(function (i) { - return _this.list({ ids: i, take: batchSize }); - }); - return Promise.all(promises).then(function (result) { return (0, lodash_1.flatMap)(result, function (c) { return c.Items; }); }); - }; - TaskRepository.prototype.createSystemTask = function (name, description, taskArguments) { - return _super.prototype.create.call(this, { - Name: name, - Description: description, - Arguments: taskArguments, - SpaceId: null, - }); - }; - TaskRepository.prototype.createSpaceScopedTask = function (name, description, taskArguments) { - if (!this.client.spaceId) { - throw new Error("Tried to create a space scoped task without being in the context of a space"); - } - return _super.prototype.create.call(this, { - Name: name, - Description: description, - Arguments: taskArguments, - SpaceId: this.client.spaceId, - }); - }; - return TaskRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.TaskRepository = TaskRepository; +//# sourceMappingURL=projectImportRequest.js.map + +/***/ }), + +/***/ 89763: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=projectImportResponse.js.map /***/ }), -/***/ 30986: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 97446: +/***/ ((__unused_webpack_module, exports) => { "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); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var TeamMembershipRepository = /** @class */ (function () { - function TeamMembershipRepository(client) { - this.client = client; - } - TeamMembershipRepository.prototype.getForUser = function (user, includeSystem) { - return this.client.get(this.client.getLink("TeamMembership"), __assign({ userId: user.Id }, (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem))); - }; - TeamMembershipRepository.prototype.previewTeam = function (team) { - return this.client.post(this.client.getLink("TeamMembershipPreviewTeam"), team); +exports.getBranchNameFromRouteParameter = exports.getURISafeBranchName = exports.isVcsBranchResource = exports.NewProject = exports.HasVersionControlledPersistenceSettings = exports.HasVcsProjectResourceLinks = exports.IsUsingUsernamePasswordAuth = exports.AuthenticationType = exports.PersistenceSettingsType = void 0; +var PersistenceSettingsType; +(function (PersistenceSettingsType) { + PersistenceSettingsType["VersionControlled"] = "VersionControlled"; + PersistenceSettingsType["Database"] = "Database"; +})(PersistenceSettingsType = exports.PersistenceSettingsType || (exports.PersistenceSettingsType = {})); +var AuthenticationType; +(function (AuthenticationType) { + AuthenticationType["Anonymous"] = "Anonymous"; + AuthenticationType["UsernamePassword"] = "UsernamePassword"; +})(AuthenticationType = exports.AuthenticationType || (exports.AuthenticationType = {})); +function IsUsingUsernamePasswordAuth(T) { + return (T.Type === + AuthenticationType.UsernamePassword); +} +exports.IsUsingUsernamePasswordAuth = IsUsingUsernamePasswordAuth; +function HasVcsProjectResourceLinks(links) { + return links.Branches !== undefined; +} +exports.HasVcsProjectResourceLinks = HasVcsProjectResourceLinks; +function HasVersionControlledPersistenceSettings(T) { + return T.Type === PersistenceSettingsType.VersionControlled; +} +exports.HasVersionControlledPersistenceSettings = HasVersionControlledPersistenceSettings; +function NewProject(name, projectGroup, lifecycle) { + return { + LifecycleId: lifecycle.Id, + Name: name, + ProjectGroupId: projectGroup.Id, }; - return TeamMembershipRepository; -}()); -exports["default"] = TeamMembershipRepository; +} +exports.NewProject = NewProject; +function isVcsBranchResource(branch) { + return branch.Name !== undefined; +} +exports.isVcsBranchResource = isVcsBranchResource; +function getURISafeBranchName(branch) { + return encodeURIComponent(branch.Name); +} +exports.getURISafeBranchName = getURISafeBranchName; +function getBranchNameFromRouteParameter(routeParameter) { + if (routeParameter) { + return decodeURIComponent(routeParameter); + } + return undefined; +} +exports.getBranchNameFromRouteParameter = getBranchNameFromRouteParameter; +//# sourceMappingURL=projectResource.js.map +/***/ }), + +/***/ 91535: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=projectSummary.js.map /***/ }), -/***/ 66168: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 40903: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TeamRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var TeamRepository = /** @class */ (function (_super) { - __extends(TeamRepository, _super); - function TeamRepository(client) { - return _super.call(this, "Teams", client) || this; - } - TeamRepository.prototype.listScopedUserRoles = function (team) { - return this.client.get(team.Links["ScopedUserRoles"], this.spacePartitionParameters()); - }; - TeamRepository.prototype.list = function (args) { - return _super.prototype.list.call(this, args); - }; - return TeamRepository; -}(mixedScopeBaseRepository_1.MixedScopeBaseRepository)); -exports.TeamRepository = TeamRepository; - +//# sourceMappingURL=projectUsage.js.map /***/ }), -/***/ 54198: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 70913: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var TenantRepository = /** @class */ (function (_super) { - __extends(TenantRepository, _super); - function TenantRepository(client) { - return _super.call(this, "Tenants", client) || this; - } - TenantRepository.prototype.find = function (namesOrIds) { - return __awaiter(this, void 0, void 0, function () { - var environments, matchingEnvironments, _a, _loop_1, this_1, _i, namesOrIds_1, name_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (namesOrIds.length === 0) - return [2 /*return*/, []]; - environments = []; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.list({ - ids: namesOrIds, - })]; - case 2: - matchingEnvironments = _b.sent(); - environments.push.apply(environments, matchingEnvironments.Items); - return [3 /*break*/, 4]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: - _loop_1 = function (name_1) { - var matchingEnvironments; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, this_1.list({ - name: name_1, - })]; - case 1: - matchingEnvironments = _c.sent(); - environments.push.apply(environments, matchingEnvironments.Items.filter(function (e) { return e.Name.localeCompare(name_1, undefined, { sensitivity: 'base' }) === 0; })); - return [2 /*return*/]; - } - }); - }; - this_1 = this; - _i = 0, namesOrIds_1 = namesOrIds; - _b.label = 5; - case 5: - if (!(_i < namesOrIds_1.length)) return [3 /*break*/, 8]; - name_1 = namesOrIds_1[_i]; - return [5 /*yield**/, _loop_1(name_1)]; - case 6: - _b.sent(); - _b.label = 7; - case 7: - _i++; - return [3 /*break*/, 5]; - case 8: return [2 /*return*/, environments]; - } - }); - }); - }; - TenantRepository.prototype.status = function () { - return this.client.get(this.client.getLink("TenantsStatus")); - }; - TenantRepository.prototype.tagTest = function (tenantIds, tags) { - return this.client.get(this.client.getLink("TenantTagTest"), { tenantIds: tenantIds, tags: tags }); - }; - TenantRepository.prototype.getVariables = function (tenant) { - return this.client.get(tenant.Links["Variables"]); - }; - TenantRepository.prototype.setVariables = function (tenant, variables) { - return this.client.put(tenant.Links["Variables"], variables); - }; - TenantRepository.prototype.missingVariables = function (filterOptions, includeDetails) { - if (filterOptions === void 0) { filterOptions = {}; } - if (includeDetails === void 0) { includeDetails = false; } - var payload = { - environmentId: filterOptions.environmentId, - includeDetails: !!includeDetails, - projectId: filterOptions.projectId, - tenantId: filterOptions.tenantId, - }; - return this.client.get(this.client.getLink("TenantsMissingVariables"), payload); - }; - TenantRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink("Tenants"), __assign({}, args)); - }; - return TenantRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = TenantRepository; - +//# sourceMappingURL=projectedTeamReferenceDataItem.js.map /***/ }), -/***/ 19652: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 28620: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var TenantVariableRepository = /** @class */ (function (_super) { - __extends(TenantVariableRepository, _super); - function TenantVariableRepository(client) { - return _super.call(this, "TenantVariables", client) || this; +exports.isSensitiveValue = exports.NewSensitiveValue = void 0; +function NewSensitiveValue(value, hint) { + return { + HasValue: true, + Hint: hint, + NewValue: value, + }; +} +exports.NewSensitiveValue = NewSensitiveValue; +function isSensitiveValue(value) { + if (typeof value === "string" || value === null) { + return false; } - return TenantVariableRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = TenantVariableRepository; - + return Object.prototype.hasOwnProperty.call(value, "HasValue"); +} +exports.isSensitiveValue = isSensitiveValue; +//# sourceMappingURL=propertyValueResource.js.map /***/ }), -/***/ 99284: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 13627: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UpgradeConfigurationRepository = void 0; -var configurationRepository_1 = __nccwpck_require__(13497); -var UpgradeConfigurationRepository = /** @class */ (function (_super) { - __extends(UpgradeConfigurationRepository, _super); - function UpgradeConfigurationRepository(client) { - return _super.call(this, "UpgradeConfiguration", client) || this; - } - return UpgradeConfigurationRepository; -}(configurationRepository_1.ConfigurationRepository)); -exports.UpgradeConfigurationRepository = UpgradeConfigurationRepository; - +//# sourceMappingURL=proxyResource.js.map /***/ }), -/***/ 67597: -/***/ ((__unused_webpack_module, exports) => { +/***/ 35168: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserIdentityMetadataRepository = void 0; -var UserIdentityMetadataRepository = /** @class */ (function () { - function UserIdentityMetadataRepository(client) { - this.client = client; +exports.isProcessReferenceDataItem = void 0; +var utils_1 = __nccwpck_require__(12765); +function isProcessReferenceDataItem(item) { + if (!item) { + return false; } - UserIdentityMetadataRepository.prototype.all = function () { - return this.client.get(this.client.getLink("UserIdentityMetadata")); - }; - UserIdentityMetadataRepository.prototype.authenticationConfiguration = function (userId) { - return this.client.get(this.client.getLink("UserAuthentication"), { userId: userId }); - }; - return UserIdentityMetadataRepository; -}()); -exports.UserIdentityMetadataRepository = UserIdentityMetadataRepository; - + var converted = item; + return (0, utils_1.isPropertyDefinedAndNotNull)(converted, "ProcessType"); +} +exports.isProcessReferenceDataItem = isProcessReferenceDataItem; +//# sourceMappingURL=referenceDataItem.js.map /***/ }), -/***/ 41025: +/***/ 43924: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserOnBoardingRepository = void 0; -var UserOnBoardingRepository = /** @class */ (function () { - function UserOnBoardingRepository(client) { - this.client = client; - } - UserOnBoardingRepository.prototype.get = function () { - return this.client.get(this.client.getLink("UserOnboarding")); - }; - return UserOnBoardingRepository; -}()); -exports.UserOnBoardingRepository = UserOnBoardingRepository; - +//# sourceMappingURL=releaseChanges.js.map /***/ }), -/***/ 27747: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 65898: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserPermissionRepository = void 0; -var mixedScopeBaseRepository_1 = __nccwpck_require__(80891); -var UserPermissionRepository = /** @class */ (function () { - function UserPermissionRepository(client) { - this.client = client; - } - UserPermissionRepository.prototype.getAllPermissions = function (user, includeSystem) { - return this.client.get(user.Links["Permissions"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)("all", includeSystem)); - }; - UserPermissionRepository.prototype.getPermissionsForCurrentSpaceContext = function (user, includeSystem) { - return this.client.get(user.Links["Permissions"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem)); - }; - UserPermissionRepository.prototype.getPermissionsConfigurationForAllParitions = function (user, includeSystem) { - return this.client.get(user.Links["PermissionsConfiguration"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)("all", includeSystem)); - }; - UserPermissionRepository.prototype.getPermissionsConfigurationForCurrentSpaceContext = function (user, includeSystem) { - return this.client.get(user.Links["PermissionsConfiguration"], (0, mixedScopeBaseRepository_1.convertToSpacePartitionParameters)(this.client.spaceId, includeSystem)); - }; - return UserPermissionRepository; -}()); -exports.UserPermissionRepository = UserPermissionRepository; - +//# sourceMappingURL=releasePackageVersionBuildInformation.js.map /***/ }), -/***/ 10895: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 91699: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var UserRepository = /** @class */ (function (_super) { - __extends(UserRepository, _super); - function UserRepository(client) { - return _super.call(this, "Users", client) || this; - } - UserRepository.prototype.createApiKey = function (user, purpose, expires) { - return this.client.post(user.Links["ApiKeys"], { Purpose: purpose, Expires: expires }); - }; - UserRepository.prototype.getCurrent = function () { - return this.client.get(this.client.getLink("CurrentUser")); - }; - UserRepository.prototype.getSpaces = function (user) { - return this.client.get(user.Links["Spaces"]); - }; - UserRepository.prototype.getTriggers = function (user) { - return this.client.get(user.Links["Triggers"]); - }; - UserRepository.prototype.listApiKeys = function (user) { - return this.client.get(user.Links["ApiKeys"], { take: this.takeAll }); - }; - UserRepository.prototype.register = function (registerCommand) { - return this.client.post(this.client.getLink("Register"), registerCommand); - }; - UserRepository.prototype.revokeApiKey = function (apiKey) { - return this.client.del(apiKey.Links["Self"]); - }; - UserRepository.prototype.signIn = function (loginCommand) { - var _this = this; - return this.client.post(this.client.getLink("SignIn"), loginCommand).then(function (authenticatedUser) { - var antiforgeryToken = _this.client.getAntiforgeryToken(); - if (!antiforgeryToken) { - throw new Error("The required anti-forgery cookie is missing. Perhaps your browser " + "or another network device is blocking cookies? " + "See http://g.octopushq.com/CSRF for more details and troubleshooting."); - } - return authenticatedUser; - }); - }; - UserRepository.prototype.signOut = function () { - return this.client.post(this.client.getLink("SignOut"), {}); - }; - return UserRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = UserRepository; - +//# sourceMappingURL=releasePackageVersionBuildInformationResource.js.map /***/ }), -/***/ 74126: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 33437: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var UserRoleRepository = /** @class */ (function (_super) { - __extends(UserRoleRepository, _super); - function UserRoleRepository(client) { - return _super.call(this, "UserRoles", client) || this; - } - return UserRoleRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = UserRoleRepository; - +//# sourceMappingURL=releaseProgressionResource.js.map /***/ }), -/***/ 72887: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 97610: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any */ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -var basicRepository_1 = __nccwpck_require__(30970); -var VariableRepository = /** @class */ (function (_super) { - __extends(VariableRepository, _super); - function VariableRepository(client) { - return _super.call(this, "Variables", client) || this; +exports.isRunbookSnapshotResource = exports.isReleaseResource = void 0; +var utils_1 = __nccwpck_require__(12765); +function isReleaseResource(resource) { + if (resource === undefined || resource === null) { + return false; } - // FIXME: cac-runbooks, need to be able to load variables for VCS runbooks too - VariableRepository.prototype.getNamesForDeploymentProcess = function (projectId, projectEnvironmentsFilter) { - return this.client.get(this.client.getLink("VariableNames"), { - project: projectId, - projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, - }); - }; - VariableRepository.prototype.getNamesForRunbookProcess = function (projectId, runbookId, projectEnvironmentsFilter) { - return this.client.get(this.client.getLink("VariableNames"), { - project: projectId, - runbook: runbookId, - projectEnvironmentsFilter: projectEnvironmentsFilter ? projectEnvironmentsFilter.join(",") : projectEnvironmentsFilter, - }); - }; - VariableRepository.prototype.getSpecialVariableNames = function () { - return this.client.get(this.client.getLink("VariableNames"), {}); - }; - // FIXME: cac-runbooks, need to be able to load variables for VCS runbooks too - VariableRepository.prototype.preview = function (projectId, runbookId, actionId, environmentId, machineId, channelId, tenantId) { - return this.client.get(this.client.getLink("VariablePreview"), { - project: projectId, - runbook: runbookId, - environment: environmentId, - channel: channelId, - tenant: tenantId, - action: actionId, - machine: machineId, - }); - }; - return VariableRepository; -}(basicRepository_1.BasicRepository)); -exports["default"] = VariableRepository; - + var converted = resource; + return (converted.Version !== undefined && + (0, utils_1.typeSafeHasOwnProperty)(converted, "Version")); +} +exports.isReleaseResource = isReleaseResource; +function isRunbookSnapshotResource(resource) { + if (resource === undefined || resource === null) { + return false; + } + var converted = resource; + return (converted.Name !== undefined && (0, utils_1.typeSafeHasOwnProperty)(converted, "Name")); +} +exports.isRunbookSnapshotResource = isRunbookSnapshotResource; +//# sourceMappingURL=releaseResource.js.map /***/ }), -/***/ 50210: +/***/ 80014: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VcsRunbookRepository = void 0; -var VcsRunbookRepository = /** @class */ (function () { - function VcsRunbookRepository(client, project, branch) { - this.client = client; - this.project = project; - this.branch = branch; - this.client = client; - } - VcsRunbookRepository.prototype.getBranch = function () { - if (!this.branch) - throw new Error("Can't use VCS Runbook Repository unless there is a branch available in the VCS Project"); - return this.branch; - }; - // TODO: @team-config-as-code create and pass in a command instead of the reasource - VcsRunbookRepository.prototype.create = function (newVcsRunbook) { - return this.client.create(this.getBranch().Links.Runbook, newVcsRunbook, {}); - }; - VcsRunbookRepository.prototype.del = function (vcsRunbook) { - return this.client.del(vcsRunbook.Links.Self, vcsRunbook); - }; - VcsRunbookRepository.prototype.get = function (id) { - return this.client.get(this.getBranch().Links.Runbook, { id: id }); - }; - VcsRunbookRepository.prototype.list = function (args) { - return this.client.get(this.getBranch().Links.Runbook, args); - }; - VcsRunbookRepository.prototype.modify = function (vcsRunbook) { - return this.client.update(vcsRunbook.Links.Self, vcsRunbook); - }; - return VcsRunbookRepository; -}()); -exports.VcsRunbookRepository = VcsRunbookRepository; - +//# sourceMappingURL=releaseTemplateResource.js.map /***/ }), -/***/ 65737: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 25462: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WorkerPoolsRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var WorkerPoolsRepository = /** @class */ (function (_super) { - __extends(WorkerPoolsRepository, _super); - function WorkerPoolsRepository(client) { - return _super.call(this, "WorkerPools", client) || this; - } - WorkerPoolsRepository.prototype.machines = function (workerPool, args) { - return this.client.get(workerPool.Links["Workers"], args); - }; - WorkerPoolsRepository.prototype.summary = function (args) { - return this.client.get(this.client.getLink("WorkerPoolsSummary"), args); - }; - WorkerPoolsRepository.prototype.sort = function (order) { - return this.client.put(this.client.getLink("WorkerPoolsSortOrder"), order); - }; - WorkerPoolsRepository.prototype.getSupportedPoolTypes = function () { - return this.client.get(this.client.getLink("WorkerPoolsSupportedTypes")); - }; - WorkerPoolsRepository.prototype.getDynamicWorkerTypes = function () { - return __awaiter(this, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.client.get(this.client.getLink("WorkerPoolsDynamicWorkerTypes"))]; - case 1: - result = _a.sent(); - return [2 /*return*/, result.WorkerTypes]; - } - }); - }); - }; - return WorkerPoolsRepository; -}(basicRepository_1.BasicRepository)); -exports.WorkerPoolsRepository = WorkerPoolsRepository; - +//# sourceMappingURL=releaseUsage.js.map /***/ }), -/***/ 91616: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 93411: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WorkerRepository = void 0; -var basicRepository_1 = __nccwpck_require__(30970); -var WorkerRepository = /** @class */ (function (_super) { - __extends(WorkerRepository, _super); - function WorkerRepository(client) { - return _super.call(this, "Workers", client) || this; - } - WorkerRepository.prototype.discover = function (host, port, type, proxyId) { - return proxyId ? this.client.get(this.client.getLink("DiscoverWorker"), { host: host, port: port, type: type, proxyId: proxyId }) : this.client.get(this.client.getLink("DiscoverWorker"), { host: host, port: port, type: type }); - }; - WorkerRepository.prototype.getConnectionStatus = function (machine) { - return this.client.get(machine.Links["Connection"]); - }; - WorkerRepository.prototype.list = function (args) { - return this.client.get(this.client.getLink("Workers"), args); - }; - return WorkerRepository; -}(basicRepository_1.BasicRepository)); -exports.WorkerRepository = WorkerRepository; - +//# sourceMappingURL=releaseUsageEntry.js.map /***/ }), -/***/ 43399: +/***/ 22245: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WorkerShellsRepository = void 0; -var WorkerShellsRepository = /** @class */ (function () { - function WorkerShellsRepository(client) { - this.client = client; - } - WorkerShellsRepository.prototype.all = function () { - return this.client.get(this.client.getLink("WorkerShells")); - }; - return WorkerShellsRepository; -}()); -exports.WorkerShellsRepository = WorkerShellsRepository; - +//# sourceMappingURL=resource.js.map /***/ }), -/***/ 871: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 40496: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Repository = void 0; -var _1 = __nccwpck_require__(80586); -var accountRepository_1 = __nccwpck_require__(9507); -var actionTemplateRepository_1 = __nccwpck_require__(67895); -var artifactRepository_1 = __nccwpck_require__(89463); -var authenticationRepository_1 = __nccwpck_require__(42583); -var buildInformationRepository_1 = __nccwpck_require__(7946); -var certificateConfigurationRepository_1 = __nccwpck_require__(4776); -var certificateRepository_1 = __nccwpck_require__(41266); -var channelRepository_1 = __nccwpck_require__(94659); -var cloudTemplateRepository_1 = __nccwpck_require__(94203); -var communityActionTemplateRepository_1 = __nccwpck_require__(69039); -var dashboardConfigurationRepository_1 = __nccwpck_require__(66446); -var dashboardRepository_1 = __nccwpck_require__(20009); -var defectRepository_1 = __nccwpck_require__(81630); -var deploymentRepository_1 = __nccwpck_require__(91848); -var dynamicExtensionRepository_1 = __nccwpck_require__(27848); -var environmentRepository_1 = __nccwpck_require__(8183); -var eventRepository_1 = __nccwpck_require__(65269); -var externalSecurityGroupProviderRepository_1 = __nccwpck_require__(22999); -var externalSecurityGroupRepository_1 = __nccwpck_require__(4387); -var externalUsersRepository_1 = __nccwpck_require__(55459); -var featuresConfigurationRepository_1 = __nccwpck_require__(56116); -var feedRepository_1 = __nccwpck_require__(20037); -var importExportActions_1 = __nccwpck_require__(18029); -var interruptionRepository_1 = __nccwpck_require__(90977); -var inviteRepository_1 = __nccwpck_require__(15228); -var letsEncryptConfigurationRepository_1 = __nccwpck_require__(78681); -var libraryVariableRepository_1 = __nccwpck_require__(64693); -var licenseRepository_1 = __nccwpck_require__(51916); -var lifecycleRepository_1 = __nccwpck_require__(56946); -var machinePolicyRepository_1 = __nccwpck_require__(154); -var machineRepository_1 = __nccwpck_require__(53015); -var machineRoleRepository_1 = __nccwpck_require__(50197); -var machineShellsRepository_1 = __nccwpck_require__(1939); -var maintenanceConfigurationRepository_1 = __nccwpck_require__(94772); -var octopusServerNodeRepository_1 = __nccwpck_require__(34819); -var packageRepository_1 = __nccwpck_require__(53378); -var performanceConfigurationRepository_1 = __nccwpck_require__(21797); -var permissionDescriptionRepository_1 = __nccwpck_require__(97886); -var progressionRepository_1 = __nccwpck_require__(53127); -var projectGroupRepository_1 = __nccwpck_require__(38331); -var projectRepository_1 = __importDefault(__nccwpck_require__(52058)); -var projectTriggerRepository_1 = __nccwpck_require__(57502); -var proxyRepository_1 = __nccwpck_require__(7358); -var releasesRepository_1 = __nccwpck_require__(87252); -var retentionDefaultConfigurationRepository_1 = __nccwpck_require__(11050); -var runbookProcessRepository_1 = __nccwpck_require__(82404); -var runbookRepository_1 = __nccwpck_require__(18312); -var runbookRunRepository_1 = __nccwpck_require__(30242); -var runbookSnapshotRepository_1 = __nccwpck_require__(73544); -var schedulerRepository_1 = __nccwpck_require__(63767); -var scopedUserRoleRepository_1 = __nccwpck_require__(18774); -var serverConfigurationRepository_1 = __nccwpck_require__(96489); -var serverStatusRepository_1 = __nccwpck_require__(84463); -var settingsRepository_1 = __importDefault(__nccwpck_require__(50924)); -var smtpConfigurationRepository_1 = __nccwpck_require__(7025); -var spaceRepository_1 = __nccwpck_require__(56836); -var subscriptionRepository_1 = __importDefault(__nccwpck_require__(94178)); -var tagSetRepository_1 = __importDefault(__nccwpck_require__(50450)); -var taskRepository_1 = __nccwpck_require__(53573); -var teamMembershipRepository_1 = __importDefault(__nccwpck_require__(30986)); -var teamRepository_1 = __nccwpck_require__(66168); -var tenantRepository_1 = __importDefault(__nccwpck_require__(54198)); -var tenantVariableRepository_1 = __importDefault(__nccwpck_require__(19652)); -var upgradeConfigurationRepository_1 = __nccwpck_require__(99284); -var userIdentityMetadataRepository_1 = __nccwpck_require__(67597); -var userOnBoardingRepository_1 = __nccwpck_require__(41025); -var userPermissionRepository_1 = __nccwpck_require__(27747); -var userRepository_1 = __importDefault(__nccwpck_require__(10895)); -var userRoleRepository_1 = __importDefault(__nccwpck_require__(74126)); -var variableRepository_1 = __importDefault(__nccwpck_require__(72887)); -var workerPoolsRepository_1 = __nccwpck_require__(65737); -var workerRepository_1 = __nccwpck_require__(91616); -var workerShellsRepository_1 = __nccwpck_require__(43399); -// Repositories provide a helpful abstraction around the Octopus Deploy API -var Repository = /** @class */ (function () { - function Repository(client) { - var _this = this; - this.client = client; - this.takeAll = 2147483647; - this.takeDefaultPageSize = 30; // Only used when we don't rely on the default that's applied server-side. - this.resolve = function (path, uriTemplateParameters) { return _this.client.resolve(path, uriTemplateParameters); }; - this.accounts = new accountRepository_1.AccountRepository(client); - this.actionTemplates = new actionTemplateRepository_1.ActionTemplateRepository(client); - this.artifacts = new artifactRepository_1.ArtifactRepository(client); - this.authentication = new authenticationRepository_1.AuthenticationRepository(client); - this.buildInformation = new buildInformationRepository_1.BuildInformationRepository(client); - this.certificateConfiguration = new certificateConfigurationRepository_1.CertificateConfigurationRepository(client); - this.certificates = new certificateRepository_1.CertificateRepository(client); - this.cloudTemplates = new cloudTemplateRepository_1.CloudTemplateRepository(client); - this.communityActionTemplates = new communityActionTemplateRepository_1.CommunityActionTemplateRepository(client); - this.dashboardConfiguration = new dashboardConfigurationRepository_1.DashboardConfigurationRepository(client); - this.dashboards = new dashboardRepository_1.DashboardRepository(client); - this.defects = new defectRepository_1.DefectRepository(client); - this.deployments = new deploymentRepository_1.DeploymentRepository(client); - this.dynamicExtensions = new dynamicExtensionRepository_1.DynamicExtensionRepository(client); - this.environments = new environmentRepository_1.EnvironmentRepository(client); - this.events = new eventRepository_1.EventRepository(client); - this.externalSecurityGroupProviders = new externalSecurityGroupProviderRepository_1.ExternalSecurityGroupProviderRepository(client); - this.externalSecurityGroups = new externalSecurityGroupRepository_1.ExternalSecurityGroupRepository(client); - this.externalUsers = new externalUsersRepository_1.ExternalUsersRepository(client); - this.featuresConfiguration = new featuresConfigurationRepository_1.FeaturesConfigurationRepository(client); - this.feeds = new feedRepository_1.FeedRepository(client); - this.importExport = new importExportActions_1.ImportExportActions(client); - this.interruptions = new interruptionRepository_1.InterruptionRepository(client); - this.invitations = new inviteRepository_1.InvitationRepository(client); - this.letsEncryptConfiguration = new letsEncryptConfigurationRepository_1.LetsEncryptConfigurationRepository(client); - this.libraryVariableSets = new libraryVariableRepository_1.LibraryVariableRepository(client); - this.licenses = new licenseRepository_1.LicenseRepository(client); - this.lifecycles = new lifecycleRepository_1.LifecycleRepository(client); - this.machinePolicies = new machinePolicyRepository_1.MachinePolicyRepository(client); - this.machineRoles = new machineRoleRepository_1.MachineRoleRepository(client); - this.machineShells = new machineShellsRepository_1.MachineShellsRepository(client); - this.machines = new machineRepository_1.MachineRepository(client); - this.maintenanceConfiguration = new maintenanceConfigurationRepository_1.MaintenanceConfigurationRepository(client); - this.octopusServerNodes = new octopusServerNodeRepository_1.OctopusServerNodeRepository(client); - this.retentionDefaultConfiguration = new retentionDefaultConfigurationRepository_1.RetentionDefaultConfigurationRepository(client); - this.runbooks = new runbookRepository_1.RunbookRepository(client); - this.runbookProcess = new runbookProcessRepository_1.RunbookProcessRepository(client); - this.runbookSnapshots = new runbookSnapshotRepository_1.RunbookSnapshotRepository(client); - this.runbookRuns = new runbookRunRepository_1.RunbookRunRepository(client); - this.packages = new packageRepository_1.PackageRepository(client); - this.performanceConfiguration = new performanceConfigurationRepository_1.PerformanceConfigurationRepository(client); - this.permissionDescriptions = new permissionDescriptionRepository_1.PermissionDescriptionRepository(client); - this.progression = new progressionRepository_1.ProgressionRepository(client); - this.projectGroups = new projectGroupRepository_1.ProjectGroupRepository(client); - this.projects = new projectRepository_1.default(client); - this.channels = new channelRepository_1.ChannelRepository(this.projects, client); - this.deploymentProcesses = new _1.DeploymentProcessRepository(this.projects, client); - this.projectTriggers = new projectTriggerRepository_1.ProjectTriggerRepository(client); - this.proxies = new proxyRepository_1.ProxyRepository(client); - this.releases = new releasesRepository_1.ReleasesRepository(client); - this.scheduler = new schedulerRepository_1.SchedulerRepository(client); - this.scopedUserRoles = new scopedUserRoleRepository_1.ScopedUserRoleRepository(client); - this.serverStatus = new serverStatusRepository_1.ServerStatusRepository(client); - this.serverConfiguration = new serverConfigurationRepository_1.ServerConfigurationRepository(client); - this.settings = new settingsRepository_1.default(client); - this.smtpConfiguration = new smtpConfigurationRepository_1.SmtpConfigurationRepository(client); - this.spaces = new spaceRepository_1.SpaceRepository(client); - this.subscriptions = new subscriptionRepository_1.default(client); - this.tagSets = new tagSetRepository_1.default(client); - this.tasks = new taskRepository_1.TaskRepository(client); - this.teams = new teamRepository_1.TeamRepository(client); - this.tenants = new tenantRepository_1.default(client); - this.tenantVariables = new tenantVariableRepository_1.default(client); - this.upgradeConfiguration = new upgradeConfigurationRepository_1.UpgradeConfigurationRepository(client); - this.userIdentityMetadata = new userIdentityMetadataRepository_1.UserIdentityMetadataRepository(client); - this.userOnboarding = new userOnBoardingRepository_1.UserOnBoardingRepository(client); - this.userPermissions = new userPermissionRepository_1.UserPermissionRepository(client); - this.teamMembership = new teamMembershipRepository_1.default(client); - this.userRoles = new userRoleRepository_1.default(client); - this.users = new userRepository_1.default(client); - this.variables = new variableRepository_1.default(client); - this.getServerInformation = client.getServerInformation.bind(client); - this.workerPools = new workerPoolsRepository_1.WorkerPoolsRepository(client); - this.workerShells = new workerShellsRepository_1.WorkerShellsRepository(client); - this.workers = new workerRepository_1.WorkerRepository(client); - } - Object.defineProperty(Repository.prototype, "spaceId", { - get: function () { - return this.client.spaceId; - }, - enumerable: false, - configurable: true - }); - Repository.prototype.forSpace = function (space) { - return __awaiter(this, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!(this.spaceId !== space.Id)) return [3 /*break*/, 2]; - _a = Repository.bind; - return [4 /*yield*/, this.client.forSpace(space.Id)]; - case 1: return [2 /*return*/, new (_a.apply(Repository, [void 0, _b.sent()]))()]; - case 2: return [2 /*return*/, this]; - } - }); - }); - }; - Repository.prototype.forSystem = function () { - return new Repository(this.client.forSystem()); - }; - Repository.prototype.switchToSpace = function (spaceId) { - return this.client.switchToSpace(spaceId); - }; - Repository.prototype.switchToSystem = function () { - this.client.switchToSystem(); - }; - return Repository; -}()); -exports.Repository = Repository; - +//# sourceMappingURL=resourceCollection.js.map /***/ }), -/***/ 15435: +/***/ 42338: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=resourceCollectionLinks.js.map + +/***/ }), +/***/ 95297: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=retentionDefaultConfigurationResource.js.map /***/ }), -/***/ 28043: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 96286: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/consistent-type-assertions */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Resolver = void 0; -var URI = __nccwpck_require__(34190); -var URITemplate = __nccwpck_require__(23423); -var Resolver = /** @class */ (function () { - function Resolver(baseUri) { - this.baseUri = baseUri; - this.baseUri = this.baseUri.endsWith("/") ? this.baseUri : this.baseUri + "/"; - var lastIndexOfMandatorySegment = this.baseUri.lastIndexOf("/api/"); - if (lastIndexOfMandatorySegment >= 1) { - this.baseUri = this.baseUri.substring(0, lastIndexOfMandatorySegment); - } - else { - if (this.baseUri.endsWith("/api")) { - this.baseUri = this.baseUri.substring(0, -4); - } - } - this.baseUri = this.baseUri.endsWith("/") ? this.baseUri.substring(0, this.baseUri.length - 1) : this.baseUri; - var parsed = URI(this.baseUri); - this.rootUri = parsed.scheme() + "://" + parsed.authority(); - this.rootUri = this.rootUri.endsWith("/") ? this.rootUri.substring(0, this.rootUri.length - 1) : this.rootUri; - } - Resolver.prototype.resolve = function (path, uriTemplateParameters) { - if (!path) { - throw new Error("The link is not set to a value"); - } - if (path.startsWith("~/")) { - path = path.substring(1, path.length); - path = this.baseUri + path; - } - else { - path = this.rootUri + path; - } - var template = new URITemplate(path); - var result = template.expand(uriTemplateParameters || {}); - return result; - }; - return Resolver; -}()); -exports.Resolver = Resolver; +exports.RetentionUnit = void 0; +var RetentionUnit; +(function (RetentionUnit) { + RetentionUnit["Days"] = "Days"; + RetentionUnit["Items"] = "Items"; +})(RetentionUnit = exports.RetentionUnit || (exports.RetentionUnit = {})); +//# sourceMappingURL=retentionPeriod.js.map + +/***/ }), + +/***/ 63216: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=rootResource.js.map /***/ }), -/***/ 82138: +/***/ 41816: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RunConditionForAction = void 0; +var RunConditionForAction; +(function (RunConditionForAction) { + RunConditionForAction["Success"] = "Success"; + RunConditionForAction["Variable"] = "Variable"; +})(RunConditionForAction = exports.RunConditionForAction || (exports.RunConditionForAction = {})); +//# sourceMappingURL=runConditionForAction.js.map + +/***/ }), + +/***/ 62668: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RunbookEnvironmentScope = void 0; +var RunbookEnvironmentScope; +(function (RunbookEnvironmentScope) { + RunbookEnvironmentScope["All"] = "All"; + RunbookEnvironmentScope["Specified"] = "Specified"; + RunbookEnvironmentScope["FromProjectLifecycles"] = "FromProjectLifecycles"; +})(RunbookEnvironmentScope = exports.RunbookEnvironmentScope || (exports.RunbookEnvironmentScope = {})); +//# sourceMappingURL=runbookEnvironmentScope.js.map /***/ }), -/***/ 60232: +/***/ 98411: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=runbookProcessResource.js.map + +/***/ }), + +/***/ 36029: +/***/ ((__unused_webpack_module, exports) => { +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=runbookProgressionResource.js.map /***/ }), -/***/ 445: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 5899: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable @typescript-eslint/no-non-null-assertion */ -/* eslint-disable no-eq-null */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Session = void 0; -var userPermissions_1 = __nccwpck_require__(54663); -var Session = /** @class */ (function () { - function Session() { - this.currentUser = undefined; - this.currentPermissions = undefined; - } - Session.prototype.start = function (user, features) { - console.info("Starting session for ".concat(user.DisplayName, " user.")); - this.currentUser = user; - }; - Session.prototype.end = function () { - if (this.currentUser) { - console.info("Ending session for ".concat(this.currentUser.DisplayName, " user.")); - } - this.currentUser = null; - this.currentPermissions = null; - }; - Session.prototype.refreshPermissions = function (userPermission) { - this.currentPermissions = userPermissions_1.UserPermissions.Create(userPermission.SpacePermissions, userPermission.SystemPermissions, userPermission.Teams); - }; - Session.prototype.isAuthenticated = function () { - return this.currentUser != null; - }; - return Session; -}()); -exports.Session = Session; -exports["default"] = Session; - +exports.IsNonVcsRunbook = void 0; +function IsNonVcsRunbook(runbook) { + return runbook.ProjectId !== undefined; +} +exports.IsNonVcsRunbook = IsNonVcsRunbook; +//# sourceMappingURL=runbookResource.js.map /***/ }), -/***/ 31547: +/***/ 11400: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SubscriptionRecord = void 0; -var SubscriptionRecord = /** @class */ (function () { - function SubscriptionRecord() { - this.subscriptions = {}; - } - SubscriptionRecord.prototype.subscribe = function (registrationName, callback) { - var _this = this; - this.subscriptions[registrationName] = callback; - return function () { return _this.unsubscribe(registrationName); }; - }; - SubscriptionRecord.prototype.unsubscribe = function (registrationName) { - delete this.subscriptions[registrationName]; - }; - SubscriptionRecord.prototype.notify = function (predicate, data) { - var _this = this; - Object.keys(this.subscriptions) - .filter(predicate) - .forEach(function (key) { return _this.subscriptions[key](data); }); - }; - SubscriptionRecord.prototype.notifyAll = function (data) { - this.notify(function () { return true; }, data); - }; - SubscriptionRecord.prototype.notifySingle = function (registrationName, data) { - if (registrationName in this.subscriptions) { - this.subscriptions[registrationName](data); - } - }; - return SubscriptionRecord; -}()); -exports.SubscriptionRecord = SubscriptionRecord; - +//# sourceMappingURL=runbookResourceLinks.js.map /***/ }), -/***/ 54663: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 26571: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -/* eslint-disable no-eq-null */ -/* eslint-disable @typescript-eslint/consistent-type-assertions */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAccessToAllProjectGroups = exports.isAccessToAllTenants = exports.isAccessToAllEnvironments = exports.isAccessToAllProjects = exports.UserPermissions = void 0; -var message_contracts_1 = __nccwpck_require__(74561); -var UserPermissions = /** @class */ (function () { - function UserPermissions(spacePermissions, systemPermissions, teams) { - this.spacePermissions = spacePermissions; - this.systemPermissions = systemPermissions; - this.teams = teams; +exports.RunbookRunParameters = void 0; +var RunbookRunParameters = (function () { + function RunbookRunParameters() { + this.EnvironmentIds = []; + this.ExcludedMachineIds = []; + this.ForcePackageDownload = false; + this.SkipActions = []; + this.SpecificMachineIds = []; + this.UseDefaultSnapshot = true; } - UserPermissions.Create = function (spacePermissions, systemPermissions, teams) { - var ps = {}; - Object.keys(spacePermissions).forEach(function (permission) { - var permissionRestrictionInAllSpaces = spacePermissions[permission]; - permissionRestrictionInAllSpaces.forEach(function (permissionRestriction) { - var permissionsForSpace = ps[permissionRestriction.SpaceId]; - if (!permissionsForSpace) { - ps[permissionRestriction.SpaceId] = {}; - } - var internalPermission = convertUserPermissionRestrictionToInternalPermissions(permissionRestriction); - var restrictionsWithinSpace = ps[permissionRestriction.SpaceId][permission.toLowerCase()]; - if (!restrictionsWithinSpace) { - ps[permissionRestriction.SpaceId][permission.toLowerCase()] = []; - } - ps[permissionRestriction.SpaceId][permission.toLowerCase()].push(internalPermission); - }); - }); - return new UserPermissions(ps, systemPermissions.map(function (p) { return p.toLowerCase(); }), teams); - }; - UserPermissions.prototype.scopeToSystem = function () { - return new UserPermissions({}, this.systemPermissions, this.teams); - }; - UserPermissions.prototype.scopeToSpace = function (spaceId) { - var _a; - if (!spaceId) { - return new UserPermissions({}, [], this.teams); - } - var permissionsForSpace = this.spacePermissions[spaceId] || {}; - return new UserPermissions((_a = {}, _a[spaceId] = permissionsForSpace, _a), [], this.teams); - }; - UserPermissions.prototype.scopeToSpaceAndSystem = function (spaceId) { - var _a; - if (!spaceId) { - return new UserPermissions({}, this.systemPermissions, this.teams); - } - var permissionsForSpace = this.spacePermissions[spaceId] || {}; - return new UserPermissions((_a = {}, _a[spaceId] = permissionsForSpace, _a), this.systemPermissions, this.teams); - }; - UserPermissions.prototype.hasAnyPermissions = function () { - var _this = this; - var hasAnySpacePermissions = Object.keys(this.spacePermissions).some(function (spaceId) { - return Object.keys(_this.spacePermissions[spaceId]).length > 0; - }); - var hasAnySystemPermissions = this.systemPermissions.length > 0; - return hasAnySpacePermissions || hasAnySystemPermissions; - }; - UserPermissions.prototype.firstAuthorized = function (permissions) { - var _this = this; - return permissions.find(function (p) { - return _this.hasSpacePermission(p) || _this.hasSystemPermission(p); - }); - }; - UserPermissions.prototype.hasPermissionInAnyScope = function (permission) { - return this.hasSpacePermission(permission) || this.hasSystemPermission(permission); - }; - UserPermissions.prototype.isAuthorized = function (authorization) { - var isInSystemPermissions = this.systemPermissions.includes(authorization.permission.toLowerCase()); - if (isInSystemPermissions) { - // these are not scoped, so if the permission is here, we're done they are Authorized - return true; - } - return this.isAuthorizedInAnySpace(authorization); - }; - UserPermissions.prototype.isAuthorizedInAnySpace = function (authorization) { - var _this = this; - return Object.keys(this.spacePermissions).some(function (spaceId) { - return isAuthorizedInSpecificSpace(_this.spacePermissions[spaceId]); - }); - function isAuthorizedInSpecificSpace(specificSpacePermissions) { - var restrictions = specificSpacePermissions[authorization.permission.toLowerCase()]; - if (!restrictions) { - // User doesn't have the permission in any scope - return false; - } - if (restrictions.length === 0) { - // No restrictions - return true; - } - for (var _i = 0, restrictions_1 = restrictions; _i < restrictions_1.length; _i++) { - var restriction = restrictions_1[_i]; - var allowed = true; - if (!isAccessToAllProjects(restriction.projectIds)) { - if (authorization.projectId == null || (!isWildcard(authorization.projectId) && !restriction.projectIds.includes(authorization.projectId.toLowerCase()))) { - allowed = false; - } - } - if (!isAccessToAllEnvironments(restriction.environmentIds)) { - if (authorization.environmentId == null || (!isWildcard(authorization.environmentId) && !restriction.environmentIds.includes(authorization.environmentId.toLowerCase()))) { - allowed = false; - } - } - if (!isAccessToAllProjectGroups(restriction.projectGroupIds)) { - if (authorization.projectGroupId == null || (!isWildcard(authorization.projectGroupId) && !restriction.projectGroupIds.includes(authorization.projectGroupId.toLowerCase()))) { - allowed = false; - } - } - if (!isAccessToAllTenants(restriction.tenantIds)) { - if (authorization.tenantId == null || (!isWildcard(authorization.tenantId) && !restriction.tenantIds.includes(authorization.tenantId.toLowerCase()))) { - allowed = false; - } - } - if (allowed) { - return true; - } - } - return false; - function isWildcard(s) { - return s === "*"; - } - } - }; - UserPermissions.prototype.isSpaceManager = function (space) { - var _this = this; - return space && space.SpaceManagersTeams.some(function (t) { return _this.teams.some(function (cpt) { return cpt.Id === t; }); }); - }; - UserPermissions.prototype.hasSpacePermission = function (permission) { - var _this = this; - var lowerCasePermission = permission.toLowerCase(); - return Object.keys(this.spacePermissions).some(function (spaceId) { - return !!_this.spacePermissions[spaceId][lowerCasePermission]; - }); - }; - UserPermissions.prototype.hasSystemPermission = function (permission) { - return this.systemPermissions.includes(permission.toLowerCase()); + RunbookRunParameters.MapFrom = function (runbookRun) { + var _a, _b, _c; + return { + EnvironmentId: runbookRun.EnvironmentId, + ExcludedMachineIds: runbookRun.ExcludedMachineIds != null ? runbookRun.ExcludedMachineIds : [], + ForcePackageDownload: runbookRun.ForcePackageDownload, + FormValues: (_a = runbookRun.FormValues) !== null && _a !== void 0 ? _a : {}, + ProjectId: runbookRun.ProjectId, + QueueTime: (_b = runbookRun.QueueTime) === null || _b === void 0 ? void 0 : _b.toString(), + QueueTimeExpiry: (_c = runbookRun.QueueTimeExpiry) === null || _c === void 0 ? void 0 : _c.toString(), + RunbookId: runbookRun.RunbookId, + SkipActions: runbookRun.SkipActions != null ? runbookRun.SkipActions : [], + SpecificMachineIds: runbookRun.SpecificMachineIds != null ? runbookRun.SpecificMachineIds : [], + TenantId: runbookRun.TenantId, + UseDefaultSnapshot: true, + UseGuidedFailure: runbookRun.UseGuidedFailure, + }; }; - return UserPermissions; + return RunbookRunParameters; }()); -exports.UserPermissions = UserPermissions; -// This type is distinct from `UserPermissionRestriction` because it is safer to have the "all" case represented by a non-array -// It is harder to make type mistakes this way, since you should be unable to assign the "all" string value to the array representing a subset of values -function convertUserPermissionRestrictionToInternalPermissions(permissionRestriction) { - var normalizedProjectRestrictions = (0, message_contracts_1.isAllProjects)(permissionRestriction.RestrictedToProjectIds) ? "Access to all projects" : permissionRestriction.RestrictedToProjectIds.map(function (id) { return id.toLowerCase(); }); - var normalizedEnvironmentRestrictions = (0, message_contracts_1.isAllEnvironments)(permissionRestriction.RestrictedToEnvironmentIds) - ? "Access to all environments" - : permissionRestriction.RestrictedToEnvironmentIds.map(function (id) { return id.toLowerCase(); }); - var normalizedProjectGroupIds = (0, message_contracts_1.isAllProjectGroups)(permissionRestriction.RestrictedToProjectGroupIds) - ? "Access to all project groups" - : permissionRestriction.RestrictedToProjectGroupIds.map(function (id) { return id.toLowerCase(); }); - var normalizedTenantIds = (0, message_contracts_1.isAllTenants)(permissionRestriction.RestrictedToTenantIds) ? "Access to all tenants" : permissionRestriction.RestrictedToTenantIds.map(function (id) { return id.toLowerCase(); }); - return { - projectIds: normalizedProjectRestrictions, - environmentIds: normalizedEnvironmentRestrictions, - projectGroupIds: normalizedProjectGroupIds, - tenantIds: normalizedTenantIds, - }; -} -function isAccessToAllProjects(restrictions) { - var accessToAllProjects = restrictions; - return typeof accessToAllProjects === "string" && accessToAllProjects === "Access to all projects"; -} -exports.isAccessToAllProjects = isAccessToAllProjects; -function isAccessToAllEnvironments(restrictions) { - var accessToAllEnvironments = restrictions; - return typeof accessToAllEnvironments === "string" && accessToAllEnvironments === "Access to all environments"; -} -exports.isAccessToAllEnvironments = isAccessToAllEnvironments; -function isAccessToAllTenants(restrictions) { - var accessToAllTenants = restrictions; - return typeof accessToAllTenants === "string" && accessToAllTenants === "Access to all tenants"; -} -exports.isAccessToAllTenants = isAccessToAllTenants; -function isAccessToAllProjectGroups(restrictions) { - var accessToAllProjectGroups = restrictions; - return typeof accessToAllProjectGroups === "string" && accessToAllProjectGroups === "Access to all project groups"; -} -exports.isAccessToAllProjectGroups = isAccessToAllProjectGroups; - +exports.RunbookRunParameters = RunbookRunParameters; +//# sourceMappingURL=runbookRunParameters.js.map /***/ }), -/***/ 47132: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 19891: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPropertyDefinedAndNotNull = exports.typeSafeHasOwnProperty = exports.ensureSuffix = exports.ensurePrefix = exports.determineServerEndpoint = exports.getResolver = exports.getServerEndpoint = exports.getQueryValue = void 0; -var lodash_1 = __nccwpck_require__(90250); -var urijs_1 = __importDefault(__nccwpck_require__(34190)); -var resolver_1 = __nccwpck_require__(28043); -var getQueryValue = function (key, location) { - var result; - (0, urijs_1.default)(location).hasQuery(key, function (value) { - result = value; - }); - return result; -}; -exports.getQueryValue = getQueryValue; -var getServerEndpoint = function (location) { - if (location === void 0) { location = window.location; } - return (0, exports.getQueryValue)("octopus.server", location.href) || (0, exports.determineServerEndpoint)(location); -}; -exports.getServerEndpoint = getServerEndpoint; -var getResolver = function (base) { - var resolver = new resolver_1.Resolver(base); - return resolver.resolve.bind(resolver); -}; -exports.getResolver = getResolver; -var determineServerEndpoint = function (location) { - var endpoint = (0, exports.ensureSuffix)("//", "" + location.protocol) + location.host; - var path = (0, exports.ensurePrefix)("/", location.pathname); - if (path.length >= 1) { - var lastSegmentIndex = path.lastIndexOf("/"); - if (lastSegmentIndex >= 0) { - path = path.substring(0, lastSegmentIndex + 1); - } - } - endpoint = endpoint + path; - return endpoint; -}; -exports.determineServerEndpoint = determineServerEndpoint; -exports.ensurePrefix = (0, lodash_1.curry)(function (prefix, value) { return (!value.startsWith(prefix) ? "".concat(prefix).concat(value) : value); }); -exports.ensureSuffix = (0, lodash_1.curry)(function (suffix, value) { return (!value.endsWith(suffix) ? "".concat(value).concat(suffix) : value); }); -var typeSafeHasOwnProperty = function (target, key) { - return target.hasOwnProperty(key); -}; -exports.typeSafeHasOwnProperty = typeSafeHasOwnProperty; -var isPropertyDefinedAndNotNull = function (target, key) { - return (0, exports.typeSafeHasOwnProperty)(target, key) && target[key] !== null && target[key] !== undefined; -}; -exports.isPropertyDefinedAndNotNull = isPropertyDefinedAndNotNull; - +//# sourceMappingURL=runbookRunResource.js.map /***/ }), -/***/ 21843: +/***/ 82034: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AADCredentialType = void 0; -var AADCredentialType; -(function (AADCredentialType) { - AADCredentialType["ClientCredential"] = "ClientCredential"; - AADCredentialType["UserCredential"] = "UserCredential"; -})(AADCredentialType = exports.AADCredentialType || (exports.AADCredentialType = {})); -//# sourceMappingURL=aadCredentialType.js.map +//# sourceMappingURL=runbookRunTemplateResource.js.map /***/ }), -/***/ 88253: +/***/ 47106: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=accountResource.js.map +//# sourceMappingURL=runbookSnapshotResource.js.map /***/ }), -/***/ 35608: +/***/ 34703: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=accountResourceLinks.js.map +//# sourceMappingURL=runbookSnapshotTemplateResource.js.map /***/ }), -/***/ 34914: +/***/ 77703: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AccountType = void 0; -var AccountType; -(function (AccountType) { - AccountType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; - AccountType["AzureServicePrincipal"] = "AzureServicePrincipal"; - AccountType["AzureSubscription"] = "AzureSubscription"; - AccountType["GoogleCloudAccount"] = "GoogleCloudAccount"; - AccountType["None"] = "None"; - AccountType["SshKeyPair"] = "SshKeyPair"; - AccountType["Token"] = "Token"; - AccountType["UsernamePassword"] = "UsernamePassword"; -})(AccountType = exports.AccountType || (exports.AccountType = {})); -//# sourceMappingURL=accountType.js.map +//# sourceMappingURL=runbooksDashboardItemResource.js.map /***/ }), -/***/ 6687: -/***/ ((__unused_webpack_module, exports) => { +/***/ 24223: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=accountUsageResource.js.map +exports.RunRunbookActionResource = exports.ScheduleIntervalResource = exports.DeployNewReleaseActionResource = exports.DeployLatestReleaseActionResource = exports.ScopedDeploymentActionResource = exports.CronTriggerScheduleResource = exports.DaysPerMonthTriggerScheduleResource = exports.ContinuousDailyTriggerScheduleResource = exports.OnceDailyTriggerScheduleResource = exports.TriggerScheduleIntervalResource = exports.TriggerScheduleResource = void 0; +var triggerActionResource_1 = __nccwpck_require__(59636); +var triggerActionType_1 = __nccwpck_require__(58574); +var triggerFilterResource_1 = __nccwpck_require__(1033); +var triggerFilterType_1 = __nccwpck_require__(30292); +var triggerScheduleIntervalType_1 = __nccwpck_require__(81599); +var TriggerScheduleResource = (function (_super) { + __extends(TriggerScheduleResource, _super); + function TriggerScheduleResource() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.Timezone = undefined; + return _this; + } + return TriggerScheduleResource; +}(triggerFilterResource_1.TriggerFilterResource)); +exports.TriggerScheduleResource = TriggerScheduleResource; +var TriggerScheduleIntervalResource = (function () { + function TriggerScheduleIntervalResource() { + this.Interval = triggerScheduleIntervalType_1.TriggerScheduleIntervalType.OnceDaily; + } + return TriggerScheduleIntervalResource; +}()); +exports.TriggerScheduleIntervalResource = TriggerScheduleIntervalResource; +var OnceDailyTriggerScheduleResource = (function (_super) { + __extends(OnceDailyTriggerScheduleResource, _super); + function OnceDailyTriggerScheduleResource() { + var _this = _super.call(this) || this; + _this.StartTime = undefined; + _this.DaysOfWeek = undefined; + _this.FilterType = triggerFilterType_1.TriggerFilterType.OnceDailySchedule; + return _this; + } + return OnceDailyTriggerScheduleResource; +}(TriggerScheduleResource)); +exports.OnceDailyTriggerScheduleResource = OnceDailyTriggerScheduleResource; +var ContinuousDailyTriggerScheduleResource = (function (_super) { + __extends(ContinuousDailyTriggerScheduleResource, _super); + function ContinuousDailyTriggerScheduleResource() { + var _this = _super.call(this) || this; + _this.RunAfter = undefined; + _this.RunUntil = undefined; + _this.Interval = triggerScheduleIntervalType_1.TriggerScheduleIntervalType.OnceHourly; + _this.DaysOfWeek = undefined; + _this.FilterType = triggerFilterType_1.TriggerFilterType.ContinuousDailySchedule; + return _this; + } + return ContinuousDailyTriggerScheduleResource; +}(TriggerScheduleResource)); +exports.ContinuousDailyTriggerScheduleResource = ContinuousDailyTriggerScheduleResource; +var DaysPerMonthTriggerScheduleResource = (function (_super) { + __extends(DaysPerMonthTriggerScheduleResource, _super); + function DaysPerMonthTriggerScheduleResource() { + var _this = _super.call(this) || this; + _this.StartTime = undefined; + _this.MonthlyScheduleType = undefined; + _this.DayOfWeek = undefined; + _this.FilterType = triggerFilterType_1.TriggerFilterType.DaysPerMonthSchedule; + return _this; + } + return DaysPerMonthTriggerScheduleResource; +}(TriggerScheduleResource)); +exports.DaysPerMonthTriggerScheduleResource = DaysPerMonthTriggerScheduleResource; +var CronTriggerScheduleResource = (function (_super) { + __extends(CronTriggerScheduleResource, _super); + function CronTriggerScheduleResource() { + var _this = _super.call(this) || this; + _this.CronExpression = undefined; + _this.FilterType = triggerFilterType_1.TriggerFilterType.CronExpressionSchedule; + return _this; + } + return CronTriggerScheduleResource; +}(TriggerScheduleResource)); +exports.CronTriggerScheduleResource = CronTriggerScheduleResource; +var ScopedDeploymentActionResource = (function (_super) { + __extends(ScopedDeploymentActionResource, _super); + function ScopedDeploymentActionResource() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.ChannelId = undefined; + _this.TenantIds = []; + _this.TenantTags = []; + _this.Variables = undefined; + return _this; + } + return ScopedDeploymentActionResource; +}(triggerActionResource_1.TriggerActionResource)); +exports.ScopedDeploymentActionResource = ScopedDeploymentActionResource; +var DeployLatestReleaseActionResource = (function (_super) { + __extends(DeployLatestReleaseActionResource, _super); + function DeployLatestReleaseActionResource() { + var _this = _super.call(this) || this; + _this.DestinationEnvironmentId = undefined; + _this.ActionType = triggerActionType_1.TriggerActionType.DeployLatestRelease; + _this.ShouldRedeployWhenReleaseIsCurrent = true; + _this.SourceEnvironmentIds = []; + return _this; + } + return DeployLatestReleaseActionResource; +}(ScopedDeploymentActionResource)); +exports.DeployLatestReleaseActionResource = DeployLatestReleaseActionResource; +var DeployNewReleaseActionResource = (function (_super) { + __extends(DeployNewReleaseActionResource, _super); + function DeployNewReleaseActionResource() { + var _this = _super.call(this) || this; + _this.EnvironmentId = undefined; + _this.VersionControlReference = undefined; + _this.ActionType = triggerActionType_1.TriggerActionType.DeployNewRelease; + return _this; + } + return DeployNewReleaseActionResource; +}(ScopedDeploymentActionResource)); +exports.DeployNewReleaseActionResource = DeployNewReleaseActionResource; +var ScheduleIntervalResource = (function () { + function ScheduleIntervalResource() { + this.IntervalType = undefined; + this.IntervalValue = undefined; + } + return ScheduleIntervalResource; +}()); +exports.ScheduleIntervalResource = ScheduleIntervalResource; +var RunRunbookActionResource = (function (_super) { + __extends(RunRunbookActionResource, _super); + function RunRunbookActionResource() { + var _this = _super.call(this) || this; + _this.EnvironmentIds = undefined; + _this.RunbookId = undefined; + _this.TenantIds = []; + _this.TenantTags = []; + _this.ActionType = triggerActionType_1.TriggerActionType.RunRunbook; + return _this; + } + return RunRunbookActionResource; +}(triggerActionResource_1.TriggerActionResource)); +exports.RunRunbookActionResource = RunRunbookActionResource; +//# sourceMappingURL=scheduledProjectTriggerResource.js.map /***/ }), -/***/ 7689: +/***/ 71606: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionExecutionLocation = void 0; -var ActionExecutionLocation; -(function (ActionExecutionLocation) { - ActionExecutionLocation["AlwaysOnTarget"] = "AlwaysOnTarget"; - ActionExecutionLocation["AlwaysOnServer"] = "AlwaysOnServer"; - ActionExecutionLocation["TargetOrServer"] = "TargetOrServer"; -})(ActionExecutionLocation = exports.ActionExecutionLocation || (exports.ActionExecutionLocation = {})); -//# sourceMappingURL=actionExecutionLocation.js.map +//# sourceMappingURL=scheduledTaskDetailsResource.js.map /***/ }), -/***/ 9801: +/***/ 19038: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionHandlerCategory = void 0; -var ActionHandlerCategory; -(function (ActionHandlerCategory) { - ActionHandlerCategory["Atlassian"] = "Atlassian"; - ActionHandlerCategory["Aws"] = "Aws"; - ActionHandlerCategory["Azure"] = "Azure"; - ActionHandlerCategory["BuiltInStep"] = "BuiltInStep"; - ActionHandlerCategory["Certificate"] = "Certificate"; - ActionHandlerCategory["Community"] = "Community"; - ActionHandlerCategory["CommunitySubCategory"] = "CommunitySubCategory"; - ActionHandlerCategory["Docker"] = "Docker"; - ActionHandlerCategory["GoogleCloud"] = "Google"; - ActionHandlerCategory["JavaAppServer"] = "JavaAppServer"; - ActionHandlerCategory["Kubernetes"] = "Kubernetes"; - ActionHandlerCategory["Other"] = "Other"; - ActionHandlerCategory["Package"] = "Package"; - ActionHandlerCategory["Script"] = "Script"; - ActionHandlerCategory["StepTemplate"] = "StepTemplate"; - ActionHandlerCategory["Terraform"] = "Terraform"; - ActionHandlerCategory["WindowsServer"] = "WindowsServer"; -})(ActionHandlerCategory = exports.ActionHandlerCategory || (exports.ActionHandlerCategory = {})); -//# sourceMappingURL=actionHandlerCategory.js.map +//# sourceMappingURL=scopeSpecificationTypes.js.map /***/ }), -/***/ 71517: +/***/ 39849: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionInputs.js.map +//# sourceMappingURL=scopeValues.js.map /***/ }), -/***/ 6531: +/***/ 63390: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionProperties.js.map +//# sourceMappingURL=scopedUserRoleResource.js.map /***/ }), -/***/ 10136: +/***/ 24752: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateCategoryResource.js.map +exports.ScriptingLanguage = void 0; +var ScriptingLanguage; +(function (ScriptingLanguage) { + ScriptingLanguage["Bash"] = "Bash"; + ScriptingLanguage["CSharp"] = "CSharp"; + ScriptingLanguage["FSharp"] = "FSharp"; + ScriptingLanguage["PowerShell"] = "PowerShell"; + ScriptingLanguage["Python"] = "Python"; +})(ScriptingLanguage = exports.ScriptingLanguage || (exports.ScriptingLanguage = {})); +//# sourceMappingURL=scriptingLanguage.js.map /***/ }), -/***/ 9947: +/***/ 54000: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateParameterDisplaySettings.js.map +//# sourceMappingURL=serverConfigurationResource.js.map /***/ }), -/***/ 48998: +/***/ 93704: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateParameterResource.js.map - -/***/ }), - -/***/ 47799: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getFeedTypesForActionType = void 0; -var feedType_1 = __nccwpck_require__(30090); -function getFeedTypesForActionType(actionType) { - switch (actionType) { - case "Octopus.DockerRun": - return [feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry]; - case "Octopus.HelmChartUpgrade": - return [feedType_1.FeedType.Helm]; - case "Octopus.JavaArchive": - case "Octopus.TomcatDeploy": - case "Octopus.WildFlyDeploy": - return [feedType_1.FeedType.Nuget, feedType_1.FeedType.BuiltIn, feedType_1.FeedType.Maven]; - case "Octopus.TentaclePackage": - case "Octopus.TransferPackage": - return [ - feedType_1.FeedType.Nuget, - feedType_1.FeedType.BuiltIn, - feedType_1.FeedType.Maven, - feedType_1.FeedType.GitHub, - ]; - } - return []; -} -exports.getFeedTypesForActionType = getFeedTypesForActionType; -//# sourceMappingURL=actionTemplateResource.js.map +//# sourceMappingURL=serverConfigurationSettingsSetResource.js.map /***/ }), -/***/ 34440: +/***/ 49281: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateSearchResource.js.map +//# sourceMappingURL=serverDocumentCount.js.map /***/ }), -/***/ 49241: +/***/ 20114: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionTemplateUsageResource.js.map +//# sourceMappingURL=serverStatusHealthResource.js.map /***/ }), -/***/ 53132: +/***/ 93060: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionUpdateOutcome = void 0; -var ActionUpdateOutcome; -(function (ActionUpdateOutcome) { - ActionUpdateOutcome["DefaultParamterValueMissing"] = "DefaultParamterValueMissing"; - ActionUpdateOutcome["ManualMergeRequired"] = "ManualMergeRequired"; - ActionUpdateOutcome["RemovedPackageInUse"] = "RemovedPackageInUse"; - ActionUpdateOutcome["Success"] = "Success"; -})(ActionUpdateOutcome = exports.ActionUpdateOutcome || (exports.ActionUpdateOutcome = {})); -//# sourceMappingURL=actionUpdateOutcome.js.map +//# sourceMappingURL=serverStatusResource.js.map /***/ }), -/***/ 56543: +/***/ 32196: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActionUpdatePackageUsedBy = void 0; -var ActionUpdatePackageUsedBy; -(function (ActionUpdatePackageUsedBy) { - ActionUpdatePackageUsedBy["ChannelRule"] = "ChannelRule"; - ActionUpdatePackageUsedBy["ProjectReleaseCreationStrategy"] = "ProjectReleaseCreationStrategy"; - ActionUpdatePackageUsedBy["ProjectVersionStrategy"] = "ProjectVersionStrategy"; -})(ActionUpdatePackageUsedBy = exports.ActionUpdatePackageUsedBy || (exports.ActionUpdatePackageUsedBy = {})); -//# sourceMappingURL=actionUpdatePackageUsedBy.js.map +//# sourceMappingURL=serverTimezoneResource.js.map /***/ }), -/***/ 40407: +/***/ 82342: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionUpdateRemovedPackageUsage.js.map +//# sourceMappingURL=settingsMetadataResource.js.map /***/ }), -/***/ 99710: +/***/ 66197: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionUpdateResource.js.map +//# sourceMappingURL=settingsValuesResource.js.map /***/ }), -/***/ 34926: +/***/ 95317: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionUpdateResultResource.js.map +//# sourceMappingURL=smtpConfigurationResource.js.map /***/ }), -/***/ 30597: +/***/ 64507: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=actionsUpdateProcessResource.js.map +//# sourceMappingURL=smtpIsConfiguredResource.js.map /***/ }), -/***/ 80778: +/***/ 26498: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=agentlessEndpointResource.js.map - -/***/ }), - -/***/ 94582: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewAmazonWebServicesAccount = void 0; -var accountType_1 = __nccwpck_require__(34914); -function NewAmazonWebServicesAccount(name, accessKey, secretKey) { +exports.NewSpace = void 0; +function NewSpace(name, spaceManagersTeams, spaceManagersTeamMembers) { return { - AccessKey: accessKey, - AccountType: accountType_1.AccountType.AmazonWebServicesAccount, Name: name, - SecretKey: secretKey, + SpaceManagersTeams: spaceManagersTeams === null || spaceManagersTeams === void 0 ? void 0 : spaceManagersTeams.map(function (t) { return t.Id; }), + SpaceManagersTeamMembers: spaceManagersTeamMembers === null || spaceManagersTeamMembers === void 0 ? void 0 : spaceManagersTeamMembers.map(function (u) { return u.Id; }), }; } -exports.NewAmazonWebServicesAccount = NewAmazonWebServicesAccount; -//# sourceMappingURL=amazonWebServicesAccountResource.js.map +exports.NewSpace = NewSpace; +//# sourceMappingURL=spaceResource.js.map /***/ }), -/***/ 30939: +/***/ 10171: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=apiKeyCreatedResource.js.map +//# sourceMappingURL=spaceRootResource.js.map /***/ }), -/***/ 18304: +/***/ 37396: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=apiKeyResource.js.map +//# sourceMappingURL=spaceScopedResource.js.map /***/ }), -/***/ 58502: +/***/ 22152: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=artifactResource.js.map +//# sourceMappingURL=spaceSearchResult.js.map /***/ }), -/***/ 16089: +/***/ 33543: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=authenticationError.js.map +//# sourceMappingURL=sshEndpointResource.js.map /***/ }), -/***/ 38639: +/***/ 94565: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AuthenticationProviderElement = void 0; -var AuthenticationProviderElement = (function () { - function AuthenticationProviderElement() { - this.CSSLinks = undefined; - this.FormsLoginEnabled = undefined; - this.IdentityType = undefined; - this.JavascriptLinks = undefined; - this.Links = undefined; - this.Name = undefined; - } - return AuthenticationProviderElement; -}()); -exports.AuthenticationProviderElement = AuthenticationProviderElement; -//# sourceMappingURL=authenticationProviderElement.js.map +//# sourceMappingURL=sshKeyPairAccountResource.js.map /***/ }), -/***/ 72866: +/***/ 32841: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=authenticationResource.js.map +//# sourceMappingURL=stepPackage.js.map /***/ }), -/***/ 64699: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 57461: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AutoDeployActionResource = void 0; -var triggerActionResource_1 = __nccwpck_require__(59636); -var triggerActionType_1 = __nccwpck_require__(58574); -var AutoDeployActionResource = (function (_super) { - __extends(AutoDeployActionResource, _super); - function AutoDeployActionResource() { - var _this = _super.call(this) || this; - _this.ShouldRedeployWhenMachineHasBeenDeployedTo = undefined; - _this.ActionType = triggerActionType_1.TriggerActionType.AutoDeploy; - return _this; - } - return AutoDeployActionResource; -}(triggerActionResource_1.TriggerActionResource)); -exports.AutoDeployActionResource = AutoDeployActionResource; -//# sourceMappingURL=autoDeployActionResource.js.map +//# sourceMappingURL=stepPackageDeploymentTargetType.js.map /***/ }), -/***/ 39349: +/***/ 24458: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=awsElasticContainerRegistryFeedResource.js.map +exports.isStepPackageEndpointResource = void 0; +function isStepPackageEndpointResource(resource) { + return "StepPackageId" in resource && "DeploymentTargetTypeId" in resource; +} +exports.isStepPackageEndpointResource = isStepPackageEndpointResource; +//# sourceMappingURL=stepPackageEndpointResource.js.map /***/ }), -/***/ 92669: +/***/ 75507: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=azureEnvironment.js.map +//# sourceMappingURL=stepPackageLinks.js.map /***/ }), -/***/ 27134: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 42857: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewAzureServicePrincipalAccount = void 0; -var accountType_1 = __nccwpck_require__(34914); -function NewAzureServicePrincipalAccount(name, subscriptionId, tenantId, applicationId, applicationPassword) { - return { - AccountType: accountType_1.AccountType.AzureServicePrincipal, - ClientId: applicationId, - Name: name, - Password: applicationPassword, - SubscriptionNumber: subscriptionId, - TenantId: tenantId, - }; -} -exports.NewAzureServicePrincipalAccount = NewAzureServicePrincipalAccount; -//# sourceMappingURL=azureServicePrincipalAccountResource.js.map +//# sourceMappingURL=stepUsage.js.map /***/ }), -/***/ 66707: +/***/ 19863: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=azureWebSite.js.map +//# sourceMappingURL=stepUsageEntry.js.map /***/ }), -/***/ 27673: +/***/ 50606: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=azureWebSiteSlot.js.map +exports.isExistingSubscriptionResource = exports.SubscriptionType = void 0; +var SubscriptionType; +(function (SubscriptionType) { + SubscriptionType["Event"] = "Event"; +})(SubscriptionType = exports.SubscriptionType || (exports.SubscriptionType = {})); +function isExistingSubscriptionResource(T) { + return T.Links !== undefined; +} +exports.isExistingSubscriptionResource = isExistingSubscriptionResource; +//# sourceMappingURL=subscriptionResource.js.map /***/ }), -/***/ 60035: +/***/ 65252: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=buildInformationResource.js.map +//# sourceMappingURL=summaryResource.js.map /***/ }), -/***/ 91173: +/***/ 51140: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=builtInFeedLinks.js.map +//# sourceMappingURL=systemInfoResource.js.map /***/ }), -/***/ 42969: +/***/ 38664: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=builtInFeedResource.js.map +//# sourceMappingURL=tagResource.js.map /***/ }), -/***/ 33477: +/***/ 44990: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=builtInFeedStatsResource.js.map +//# sourceMappingURL=tagSetResource.js.map /***/ }), -/***/ 39021: +/***/ 30874: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=certificateConfigurationResource.js.map +exports.ActivityLogEntryCategory = exports.ActivityStatus = void 0; +var ActivityStatus; +(function (ActivityStatus) { + ActivityStatus["Pending"] = "Pending"; + ActivityStatus["Running"] = "Running"; + ActivityStatus["Success"] = "Success"; + ActivityStatus["Failed"] = "Failed"; + ActivityStatus["Skipped"] = "Skipped"; + ActivityStatus["SuccessWithWarning"] = "SuccessWithWarning"; + ActivityStatus["Canceled"] = "Canceled"; +})(ActivityStatus = exports.ActivityStatus || (exports.ActivityStatus = {})); +var ActivityLogEntryCategory; +(function (ActivityLogEntryCategory) { + ActivityLogEntryCategory["Trace"] = "Trace"; + ActivityLogEntryCategory["Verbose"] = "Verbose"; + ActivityLogEntryCategory["Info"] = "Info"; + ActivityLogEntryCategory["Highlight"] = "Highlight"; + ActivityLogEntryCategory["Wait"] = "Wait"; + ActivityLogEntryCategory["Gap"] = "Gap"; + ActivityLogEntryCategory["Alert"] = "Alert"; + ActivityLogEntryCategory["Warning"] = "Warning"; + ActivityLogEntryCategory["Error"] = "Error"; + ActivityLogEntryCategory["Fatal"] = "Fatal"; + ActivityLogEntryCategory["Planned"] = "Planned"; + ActivityLogEntryCategory["Updated"] = "Updated"; + ActivityLogEntryCategory["Finished"] = "Finished"; + ActivityLogEntryCategory["Abandoned"] = "Abandoned"; +})(ActivityLogEntryCategory = exports.ActivityLogEntryCategory || (exports.ActivityLogEntryCategory = {})); +//# sourceMappingURL=taskDetailsResource.js.map /***/ }), -/***/ 50699: +/***/ 87516: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=certificateResource.js.map +exports.TaskName = void 0; +var TaskName; +(function (TaskName) { + TaskName["Health"] = "Health"; + TaskName["AdHocScript"] = "AdHocScript"; + TaskName["ConfigureLetsEncrypt"] = "ConfigureLetsEncrypt"; + TaskName["Upgrade"] = "Upgrade"; + TaskName["TestEmail"] = "TestEmail"; + TaskName["TestAccount"] = "TestAccount"; + TaskName["SystemIntegrityCheck"] = "SystemIntegrityCheck"; + TaskName["SyncCommunityActionTemplates"] = "SyncCommunityActionTemplates"; + TaskName["SynchronizeBuiltInPackageRepositoryIndex"] = "SynchronizeBuiltInPackageRepositoryIndex"; + TaskName["UpdateCalamari"] = "UpdateCalamari"; +})(TaskName = exports.TaskName || (exports.TaskName = {})); +//# sourceMappingURL=taskName.js.map /***/ }), -/***/ 94840: +/***/ 84199: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=certificateUsageResource.js.map +//# sourceMappingURL=taskResource.js.map /***/ }), -/***/ 18754: +/***/ 84955: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=channelOclResource.js.map +exports.TaskRestrictedTo = void 0; +var TaskRestrictedTo; +(function (TaskRestrictedTo) { + TaskRestrictedTo["DeploymentTargets"] = "DeploymentTargets"; + TaskRestrictedTo["Workers"] = "Workers"; + TaskRestrictedTo["Policies"] = "Policies"; + TaskRestrictedTo["Unrestricted"] = "Unrestricted"; +})(TaskRestrictedTo = exports.TaskRestrictedTo || (exports.TaskRestrictedTo = {})); +//# sourceMappingURL=taskRestrictedTo.js.map /***/ }), -/***/ 90097: +/***/ 36445: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=channelProgressionResource.js.map +exports.TaskState = void 0; +var TaskState; +(function (TaskState) { + TaskState["Canceled"] = "Canceled"; + TaskState["Cancelling"] = "Cancelling"; + TaskState["Executing"] = "Executing"; + TaskState["Failed"] = "Failed"; + TaskState["Queued"] = "Queued"; + TaskState["Success"] = "Success"; + TaskState["TimedOut"] = "TimedOut"; +})(TaskState = exports.TaskState || (exports.TaskState = {})); +//# sourceMappingURL=taskState.js.map /***/ }), -/***/ 52739: +/***/ 20736: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewChannel = void 0; -function NewChannel(name, projectId) { - return { - Name: name, - ProjectId: projectId, - }; -} -exports.NewChannel = NewChannel; -//# sourceMappingURL=channelResource.js.map +//# sourceMappingURL=teamMembership.js.map /***/ }), -/***/ 78766: +/***/ 54797: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=channelVersionRuleResource.js.map +//# sourceMappingURL=teamResource.js.map /***/ }), -/***/ 21303: +/***/ 31113: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=commitCommand.js.map +//# sourceMappingURL=tenantMissingVariablesResource.js.map /***/ }), -/***/ 3712: +/***/ 67683: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=commitDetail.js.map +//# sourceMappingURL=tenantResource.js.map /***/ }), -/***/ 27734: +/***/ 77693: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=commonTriggerResource.js.map +//# sourceMappingURL=tenantVariableResource.js.map /***/ }), -/***/ 19170: +/***/ 68517: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CommunicationStyle = void 0; -var CommunicationStyle; -(function (CommunicationStyle) { - CommunicationStyle["AzureCloudService"] = "AzureCloudService"; - CommunicationStyle["AzureServiceFabricCluster"] = "AzureServiceFabricCluster"; - CommunicationStyle["AzureWebApp"] = "AzureWebApp"; - CommunicationStyle["Kubernetes"] = "Kubernetes"; - CommunicationStyle["None"] = "None"; - CommunicationStyle["OfflineDrop"] = "OfflineDrop"; - CommunicationStyle["Ssh"] = "Ssh"; - CommunicationStyle["StepPackage"] = "StepPackage"; - CommunicationStyle["TentacleActive"] = "TentacleActive"; - CommunicationStyle["TentaclePassive"] = "TentaclePassive"; -})(CommunicationStyle = exports.CommunicationStyle || (exports.CommunicationStyle = {})); -//# sourceMappingURL=communicationStyle.js.map +exports.TenantedDeploymentMode = void 0; +var TenantedDeploymentMode; +(function (TenantedDeploymentMode) { + TenantedDeploymentMode["Untenanted"] = "Untenanted"; + TenantedDeploymentMode["TenantedOrUntenanted"] = "TenantedOrUntenanted"; + TenantedDeploymentMode["Tenanted"] = "Tenanted"; +})(TenantedDeploymentMode = exports.TenantedDeploymentMode || (exports.TenantedDeploymentMode = {})); +//# sourceMappingURL=tenantedDeploymentMode.js.map /***/ }), -/***/ 99930: -/***/ ((__unused_webpack_module, exports) => { +/***/ 70229: +/***/ (function(__unused_webpack_module, exports) { "use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=communityActionTemplateResource.js.map +exports.TimeSpanString = void 0; +var TimeSpanString = (function (_super) { + __extends(TimeSpanString, _super); + function TimeSpanString() { + return _super !== null && _super.apply(this, arguments) || this; + } + TimeSpanString.Zero = "00:00:00"; + TimeSpanString.OneHour = "0.01:00:00"; + TimeSpanString.TenSeconds = "00:00:10"; + return TimeSpanString; +}(String)); +exports.TimeSpanString = TimeSpanString; +//# sourceMappingURL=timeSpan.js.map /***/ }), -/***/ 42546: +/***/ 34170: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ControlType = void 0; -var ControlType; -(function (ControlType) { - ControlType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; - ControlType["AzureAccount"] = "AzureAccount"; - ControlType["Certificate"] = "Certificate"; - ControlType["Checkbox"] = "Checkbox"; - ControlType["Custom"] = "Custom"; - ControlType["GoogleCloudAccount"] = "GoogleCloudAccount"; - ControlType["MultiLineText"] = "MultiLineText"; - ControlType["Package"] = "Package"; - ControlType["Select"] = "Select"; - ControlType["Sensitive"] = "Sensitive"; - ControlType["SingleLineText"] = "SingleLineText"; - ControlType["StepName"] = "StepName"; - ControlType["WorkerPool"] = "WorkerPool"; -})(ControlType = exports.ControlType || (exports.ControlType = {})); -//# sourceMappingURL=controlType.js.map +exports.TriggerActionCategory = void 0; +var TriggerActionCategory; +(function (TriggerActionCategory) { + TriggerActionCategory["Deployment"] = "Deployment"; + TriggerActionCategory["Runbook"] = "Runbook"; +})(TriggerActionCategory = exports.TriggerActionCategory || (exports.TriggerActionCategory = {})); +//# sourceMappingURL=triggerActionCategory.js.map /***/ }), -/***/ 83382: +/***/ 59636: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=convertProjectToVersionControlledCommand.js.map +exports.TriggerActionResource = void 0; +var TriggerActionResource = (function () { + function TriggerActionResource() { + this.ActionType = undefined; + } + return TriggerActionResource; +}()); +exports.TriggerActionResource = TriggerActionResource; +//# sourceMappingURL=triggerActionResource.js.map /***/ }), -/***/ 20006: +/***/ 58574: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardConfigurationResource.js.map +exports.TriggerActionType = void 0; +var TriggerActionType; +(function (TriggerActionType) { + TriggerActionType["AutoDeploy"] = "AutoDeploy"; + TriggerActionType["DeployLatestRelease"] = "DeployLatestRelease"; + TriggerActionType["DeployNewRelease"] = "DeployNewRelease"; + TriggerActionType["RunRunbook"] = "RunRunbook"; +})(TriggerActionType = exports.TriggerActionType || (exports.TriggerActionType = {})); +//# sourceMappingURL=triggerActionType.js.map /***/ }), -/***/ 26289: +/***/ 1033: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardEnvironmentResource.js.map +exports.TriggerFilterResource = void 0; +var TriggerFilterResource = (function () { + function TriggerFilterResource() { + this.FilterType = undefined; + } + return TriggerFilterResource; +}()); +exports.TriggerFilterResource = TriggerFilterResource; +//# sourceMappingURL=triggerFilterResource.js.map /***/ }), -/***/ 64543: +/***/ 30292: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardItemResource.js.map +exports.TriggerFilterType = void 0; +var TriggerFilterType; +(function (TriggerFilterType) { + TriggerFilterType["CronExpressionSchedule"] = "CronExpressionSchedule"; + TriggerFilterType["ContinuousDailySchedule"] = "ContinuousDailySchedule"; + TriggerFilterType["DaysPerMonthSchedule"] = "DaysPerMonthSchedule"; + TriggerFilterType["MachineFilter"] = "MachineFilter"; + TriggerFilterType["OnceDailySchedule"] = "OnceDailySchedule"; +})(TriggerFilterType = exports.TriggerFilterType || (exports.TriggerFilterType = {})); +//# sourceMappingURL=triggerFilterType.js.map /***/ }), -/***/ 88640: +/***/ 78010: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardProjectGroupResource.js.map +exports.isExistingTriggerResource = void 0; +function isExistingTriggerResource(resource) { + return resource.Links !== undefined; +} +exports.isExistingTriggerResource = isExistingTriggerResource; +//# sourceMappingURL=triggerResource.js.map /***/ }), -/***/ 21706: +/***/ 81599: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardProjectResource.js.map +exports.TriggerScheduleIntervalType = void 0; +var TriggerScheduleIntervalType; +(function (TriggerScheduleIntervalType) { + TriggerScheduleIntervalType["OnceDaily"] = "OnceDaily"; + TriggerScheduleIntervalType["OnceHourly"] = "OnceHourly"; + TriggerScheduleIntervalType["OnceEveryMinute"] = "OnceEveryMinute"; +})(TriggerScheduleIntervalType = exports.TriggerScheduleIntervalType || (exports.TriggerScheduleIntervalType = {})); +//# sourceMappingURL=triggerScheduleIntervalType.js.map /***/ }), -/***/ 65120: +/***/ 54638: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardResource.js.map +exports.UpgradeNotificationMode = void 0; +var UpgradeNotificationMode; +(function (UpgradeNotificationMode) { + UpgradeNotificationMode["AlwaysShow"] = "AlwaysShow"; + UpgradeNotificationMode["ShowOnlyMajorMinor"] = "ShowOnlyMajorMinor"; + UpgradeNotificationMode["NeverShow"] = "NeverShow"; +})(UpgradeNotificationMode = exports.UpgradeNotificationMode || (exports.UpgradeNotificationMode = {})); +//# sourceMappingURL=upgradeConfigurationResource.js.map /***/ }), -/***/ 60599: +/***/ 41823: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dashboardTenantResource.js.map +//# sourceMappingURL=userAuthenticationResource.js.map /***/ }), -/***/ 61676: +/***/ 69838: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=defectResource.js.map +//# sourceMappingURL=userIdentityMetadataResource.js.map /***/ }), -/***/ 71615: +/***/ 45206: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefectStatus = void 0; -var DefectStatus; -(function (DefectStatus) { - DefectStatus["Resolved"] = "Resolved"; - DefectStatus["Unresolved"] = "Unresolved"; -})(DefectStatus = exports.DefectStatus || (exports.DefectStatus = {})); -//# sourceMappingURL=defectStatus.js.map +exports.isAllProjectGroups = exports.isAllTenants = exports.isAllEnvironments = exports.isAllProjects = void 0; +function isAllProjects(restrictions) { + var allProjects = restrictions; + return (allProjects.length === 1 && + (allProjects[0] === "projects-all" || + allProjects[0] === "projects-unrelated")); +} +exports.isAllProjects = isAllProjects; +function isAllEnvironments(restrictions) { + var allEnvironments = restrictions; + return (allEnvironments.length === 1 && + (allEnvironments[0] === "environments-all" || + allEnvironments[0] === "environments-unrelated")); +} +exports.isAllEnvironments = isAllEnvironments; +function isAllTenants(restrictions) { + var allTenants = restrictions; + return (allTenants.length === 1 && + (allTenants[0] === "tenants-all" || allTenants[0] === "tenants-unrelated")); +} +exports.isAllTenants = isAllTenants; +function isAllProjectGroups(restrictions) { + var allProjectGroups = restrictions; + return (allProjectGroups.length === 1 && + (allProjectGroups[0] === "projectgroups-all" || + allProjectGroups[0] === "projectgroups-unrelated")); +} +exports.isAllProjectGroups = isAllProjectGroups; +//# sourceMappingURL=userPermissionRestriction.js.map /***/ }), -/***/ 26994: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 36604: +/***/ ((__unused_webpack_module, exports) => { "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; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (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; -}; -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)); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InitialisePrimaryPackageReference = exports.SetPrimaryPackageReference = exports.SetNamedPackageReference = exports.GetNamedPackageReferences = exports.IsNamedPackageReference = exports.GetPrimaryPackageReference = exports.HasManualInterventionResponsibleTeams = exports.PackageReferenceNamesMatch = exports.RemovePrimaryPackageReference = exports.IsPrimaryPackageReference = exports.IsDeployReleaseAction = void 0; -var _ = __importStar(__nccwpck_require__(90250)); -var feedType_1 = __nccwpck_require__(30090); -var packageAcquisitionLocation_1 = __nccwpck_require__(37648); -var packageReference_1 = __nccwpck_require__(66933); -function parseCSV(val) { - if (!val || val === "") { - return []; - } - return val.split(","); -} -function IsDeployReleaseAction(action) { - return !!action.Properties["Octopus.Action.DeployRelease.ProjectId"]; -} -exports.IsDeployReleaseAction = IsDeployReleaseAction; -function IsPrimaryPackageReference(pkg) { - return !pkg.Name; -} -exports.IsPrimaryPackageReference = IsPrimaryPackageReference; -function RemovePrimaryPackageReference(packages) { - return _.filter(packages, function (pkg) { return !IsPrimaryPackageReference(pkg); }); -} -exports.RemovePrimaryPackageReference = RemovePrimaryPackageReference; -function PackageReferenceNamesMatch(nameA, nameB) { - if (!nameA) { - return !nameB; - } - return nameA === nameB; -} -exports.PackageReferenceNamesMatch = PackageReferenceNamesMatch; -function HasManualInterventionResponsibleTeams(action) { - return _.some(parseCSV(action.Properties["Octopus.Action.Manual.ResponsibleTeamIds"])); -} -exports.HasManualInterventionResponsibleTeams = HasManualInterventionResponsibleTeams; -function GetPrimaryPackageReference(packages) { - return packages === null || packages === void 0 ? void 0 : packages.find(function (pkg) { return IsPrimaryPackageReference(pkg); }); -} -exports.GetPrimaryPackageReference = GetPrimaryPackageReference; -function IsNamedPackageReference(pkg) { - return !!pkg.Name; -} -exports.IsNamedPackageReference = IsNamedPackageReference; -function GetNamedPackageReferences(packages) { - return RemovePrimaryPackageReference(packages); -} -exports.GetNamedPackageReferences = GetNamedPackageReferences; -function SetNamedPackageReference(name, updated, packages) { - return _.map(packages, function (pkg) { - if (!PackageReferenceNamesMatch(name, pkg.Name)) { - return pkg; - } - return __assign(__assign({}, pkg), updated); - }); -} -exports.SetNamedPackageReference = SetNamedPackageReference; -function SetPrimaryPackageReference(updated, packages) { - return _.map(packages, function (pkg) { - if (!IsPrimaryPackageReference(pkg)) { - return pkg; - } - return __assign(__assign({}, pkg), updated); - }); -} -exports.SetPrimaryPackageReference = SetPrimaryPackageReference; -function InitialisePrimaryPackageReference(packages, feeds, itemsKeyedBy) { - var primaryPackage = GetPrimaryPackageReference(packages); - if (primaryPackage) { - if (!primaryPackage.Properties.SelectionMode) { - primaryPackage.Properties.SelectionMode = packageReference_1.PackageSelectionMode.Immediate; - } - return __spreadArray([], packages, true); - } - var packagesWithoutDefault = RemovePrimaryPackageReference(packages); - var builtInFeed = feeds.find(function (f) { return f.FeedType === feedType_1.FeedType.BuiltIn; }); - var builtInFeedIdOrName = builtInFeed && builtInFeed[itemsKeyedBy]; - return __spreadArray([ - { - Id: null, - PackageId: null, - FeedId: builtInFeedIdOrName, - AcquisitionLocation: packageAcquisitionLocation_1.PackageAcquisitionLocation.Server, - Properties: { - SelectionMode: packageReference_1.PackageSelectionMode.Immediate, - }, - } - ], packagesWithoutDefault, true); -} -exports.InitialisePrimaryPackageReference = InitialisePrimaryPackageReference; -//# sourceMappingURL=deploymentActionResource.js.map +//# sourceMappingURL=userPermissionSetResource.js.map /***/ }), -/***/ 40633: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 50872: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isDeploymentPreviewResource = void 0; -var utils_1 = __nccwpck_require__(12765); -function isDeploymentPreviewResource(resource) { - var converted = resource; - return (converted.Changes !== undefined && - (0, utils_1.typeSafeHasOwnProperty)(converted, "Changes")); -} -exports.isDeploymentPreviewResource = isDeploymentPreviewResource; -//# sourceMappingURL=deploymentPreviewResource.js.map +//# sourceMappingURL=userResource.js.map /***/ }), -/***/ 157: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 24456: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.processResourcePermission = exports.isRunbookProcessResource = exports.isDeploymentProcessResource = void 0; -var permission_1 = __nccwpck_require__(49346); -var utils_1 = __nccwpck_require__(12765); -function isDeploymentProcessResource(resource) { - if (resource === null || resource === undefined) { - return false; - } - var converted = resource; - return (!isRunbookProcessResource(resource) && - converted.Version !== undefined && - (0, utils_1.typeSafeHasOwnProperty)(converted, "Version")); -} -exports.isDeploymentProcessResource = isDeploymentProcessResource; -function isRunbookProcessResource(resource) { - if (resource === null || resource === undefined) { - return false; - } - var converted = resource; - return (converted.RunbookId !== undefined && - (0, utils_1.typeSafeHasOwnProperty)(converted, "RunbookId")); -} -exports.isRunbookProcessResource = isRunbookProcessResource; -function processResourcePermission(resource) { - var isRunbook = isRunbookProcessResource(resource); - return isRunbook ? permission_1.Permission.RunbookEdit : permission_1.Permission.ProcessEdit; -} -exports.processResourcePermission = processResourcePermission; -//# sourceMappingURL=deploymentProcessResource.js.map +exports.UserRoleConstants = void 0; +exports.UserRoleConstants = { + SpaceManagerRole: "userroles-spacemanager", +}; +//# sourceMappingURL=userRoleResource.js.map /***/ }), -/***/ 71976: -/***/ ((__unused_webpack_module, exports) => { +/***/ 54861: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=deploymentResource.js.map +exports.NewUsernamePasswordAccount = void 0; +var accountType_1 = __nccwpck_require__(34914); +function NewUsernamePasswordAccount(name, username, password) { + return { + AccountType: accountType_1.AccountType.UsernamePassword, + Name: name, + Password: password, + Username: username, + }; +} +exports.NewUsernamePasswordAccount = NewUsernamePasswordAccount; +//# sourceMappingURL=usernamePasswordAccountResource.js.map /***/ }), -/***/ 81741: +/***/ 12765: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GuidedFailureMode = void 0; -var GuidedFailureMode; -(function (GuidedFailureMode) { - GuidedFailureMode["EnvironmentDefault"] = "EnvironmentDefault"; - GuidedFailureMode["Off"] = "Off"; - GuidedFailureMode["On"] = "On"; -})(GuidedFailureMode = exports.GuidedFailureMode || (exports.GuidedFailureMode = {})); -//# sourceMappingURL=deploymentSettingsResource.js.map +exports.isPropertyDefinedAndNotNull = exports.typeSafeHasOwnProperty = void 0; +var typeSafeHasOwnProperty = function (target, key) { + return target.hasOwnProperty(key); +}; +exports.typeSafeHasOwnProperty = typeSafeHasOwnProperty; +var isPropertyDefinedAndNotNull = function (target, key) { + return ((0, exports.typeSafeHasOwnProperty)(target, key) && + target[key] !== null && + target[key] !== undefined); +}; +exports.isPropertyDefinedAndNotNull = isPropertyDefinedAndNotNull; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 10322: +/***/ 7151: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageRequirement = exports.RunCondition = exports.StartTrigger = void 0; -var StartTrigger; -(function (StartTrigger) { - StartTrigger["StartWithPrevious"] = "StartWithPrevious"; - StartTrigger["StartAfterPrevious"] = "StartAfterPrevious"; -})(StartTrigger = exports.StartTrigger || (exports.StartTrigger = {})); -var RunCondition; -(function (RunCondition) { - RunCondition["Success"] = "Success"; - RunCondition["Failure"] = "Failure"; - RunCondition["Always"] = "Always"; - RunCondition["Variable"] = "Variable"; -})(RunCondition = exports.RunCondition || (exports.RunCondition = {})); -var PackageRequirement; -(function (PackageRequirement) { - PackageRequirement["LetOctopusDecide"] = "LetOctopusDecide"; - PackageRequirement["BeforePackageAcquisition"] = "BeforePackageAcquisition"; - PackageRequirement["AfterPackageAcquisition"] = "AfterPackageAcquisition"; -})(PackageRequirement = exports.PackageRequirement || (exports.PackageRequirement = {})); -//# sourceMappingURL=deploymentStepResource.js.map +//# sourceMappingURL=variablePromptOptions.js.map /***/ }), -/***/ 9042: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 90269: +/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isDeploymentTarget = exports.NewDeploymentTarget = void 0; -var machineResource_1 = __nccwpck_require__(82705); -function NewDeploymentTarget(name, endpoint, environments, roles, tenantedDeploymentParticipation) { - return { - IsDisabled: false, - IsInProcess: false, - Endpoint: endpoint, - EnvironmentIds: environments.map(function (e) { return e.Id; }), - HasLatestCalamari: false, - HealthStatus: machineResource_1.MachineModelHealthStatus.Unknown, - Name: name, - MachinePolicyId: "", - Roles: roles, - TenantedDeploymentParticipation: tenantedDeploymentParticipation, - TenantIds: [], - TenantTags: [], - }; -} -exports.NewDeploymentTarget = NewDeploymentTarget; -function isDeploymentTarget(machine) { - return machine.EnvironmentIds !== undefined; -} -exports.isDeploymentTarget = isDeploymentTarget; -//# sourceMappingURL=deploymentTargetResource.js.map +//# sourceMappingURL=variableResource.js.map /***/ }), -/***/ 95369: +/***/ 32280: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeploymentTargetTaskType = void 0; -var DeploymentTargetTaskType; -(function (DeploymentTargetTaskType) { - DeploymentTargetTaskType["Deployment"] = "Deployment"; - DeploymentTargetTaskType["RunbookRun"] = "RunbookRun"; -})(DeploymentTargetTaskType = exports.DeploymentTargetTaskType || (exports.DeploymentTargetTaskType = {})); -//# sourceMappingURL=deploymentTargetTaskType.js.map +exports.VariableSetContentType = void 0; +var VariableSetContentType; +(function (VariableSetContentType) { + VariableSetContentType["Variables"] = "Variables"; + VariableSetContentType["ScriptModule"] = "ScriptModule"; +})(VariableSetContentType = exports.VariableSetContentType || (exports.VariableSetContentType = {})); +//# sourceMappingURL=variableSetContentType.js.map /***/ }), -/***/ 48798: +/***/ 36186: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=deploymentTemplateResource.js.map +//# sourceMappingURL=variableSetResource.js.map /***/ }), -/***/ 67788: +/***/ 71283: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=deploymentTemplateStep.js.map +exports.VariableType = void 0; +var VariableType; +(function (VariableType) { + VariableType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; + VariableType["AzureAccount"] = "AzureAccount"; + VariableType["Certificate"] = "Certificate"; + VariableType["GoogleCloudAccount"] = "GoogleCloudAccount"; + VariableType["Sensitive"] = "Sensitive"; + VariableType["String"] = "String"; + VariableType["WorkerPool"] = "WorkerPool"; +})(VariableType = exports.VariableType || (exports.VariableType = {})); +//# sourceMappingURL=variableType.js.map /***/ }), -/***/ 69297: +/***/ 71879: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=documentSummary.js.map +//# sourceMappingURL=variablesScopedToEnvironmentResponse.js.map /***/ }), -/***/ 33162: +/***/ 63823: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dynamicExtensionsFeaturesMetadataResource.js.map +//# sourceMappingURL=vcsRunbookResourceLinks.js.map /***/ }), -/***/ 91606: +/***/ 94620: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dynamicExtensionsFeaturesValuesResource.js.map +exports.getBasePathToShowByDefault = exports.branchNameToShowByDefault = void 0; +exports.branchNameToShowByDefault = "main"; +var getBasePathToShowByDefault = function (projectName) { + return ".octopus/".concat(projectName); +}; +exports.getBasePathToShowByDefault = getBasePathToShowByDefault; +//# sourceMappingURL=versionControlledResource.js.map /***/ }), -/***/ 85284: +/***/ 82668: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=dynamicExtensionsScriptsResource.js.map +//# sourceMappingURL=versionRuleTestResponse.js.map /***/ }), -/***/ 36747: +/***/ 51496: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConnectivityCheckResponseMessageCategory = exports.PropertyApplicabilityMode = void 0; -var PropertyApplicabilityMode; -(function (PropertyApplicabilityMode) { - PropertyApplicabilityMode["ApplicableIfHasAnyValue"] = "ApplicableIfHasAnyValue"; - PropertyApplicabilityMode["ApplicableIfHasNoValue"] = "ApplicableIfHasNoValue"; - PropertyApplicabilityMode["ApplicableIfSpecificValue"] = "ApplicableIfSpecificValue"; - PropertyApplicabilityMode["ApplicableIfNotSpecificValue"] = "ApplicableIfNotSpecificValue"; -})(PropertyApplicabilityMode = exports.PropertyApplicabilityMode || (exports.PropertyApplicabilityMode = {})); -var ConnectivityCheckResponseMessageCategory; -(function (ConnectivityCheckResponseMessageCategory) { - ConnectivityCheckResponseMessageCategory["Info"] = "Info"; - ConnectivityCheckResponseMessageCategory["Warning"] = "Warning"; - ConnectivityCheckResponseMessageCategory["Error"] = "Error"; -})(ConnectivityCheckResponseMessageCategory = exports.ConnectivityCheckResponseMessageCategory || (exports.ConnectivityCheckResponseMessageCategory = {})); -//# sourceMappingURL=dynamicFormResources.js.map +//# sourceMappingURL=workItemLink.js.map /***/ }), -/***/ 34830: +/***/ 24090: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EmailPriority = void 0; -var EmailPriority; -(function (EmailPriority) { - EmailPriority["Low"] = "Low"; - EmailPriority["Normal"] = "Normal"; - EmailPriority["High"] = "High"; -})(EmailPriority = exports.EmailPriority || (exports.EmailPriority = {})); -//# sourceMappingURL=emailPriority.js.map +exports.isWorkerMachine = void 0; +function isWorkerMachine(machine) { + return machine.WorkerPoolIds !== undefined; +} +exports.isWorkerMachine = isWorkerMachine; +//# sourceMappingURL=workerMachineResource.js.map /***/ }), -/***/ 93373: +/***/ 3282: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewEndpoint = void 0; -function NewEndpoint(name, communicationStyle) { - return { - CommunicationStyle: communicationStyle, - Name: name, - }; -} -exports.NewEndpoint = NewEndpoint; -//# sourceMappingURL=endpointResource.js.map +//# sourceMappingURL=workerPoolResource.js.map /***/ }), -/***/ 34042: +/***/ 99028: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=environmentResource.js.map +//# sourceMappingURL=workerPoolResourceBase.js.map /***/ }), -/***/ 31719: +/***/ 48773: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=environmentResourceLinks.js.map +//# sourceMappingURL=workerPoolSummary.js.map /***/ }), -/***/ 78157: +/***/ 51578: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=environmentSummaryResource.js.map +//# sourceMappingURL=workerPoolSummaryResource.js.map /***/ }), -/***/ 47479: +/***/ 30742: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=environmentsSummaryResource.js.map +exports.WorkerPoolType = void 0; +var WorkerPoolType; +(function (WorkerPoolType) { + WorkerPoolType["Static"] = "StaticWorkerPool"; + WorkerPoolType["Dynamic"] = "DynamicWorkerPool"; +})(WorkerPoolType = exports.WorkerPoolType || (exports.WorkerPoolType = {})); +//# sourceMappingURL=workerPoolType.js.map /***/ }), -/***/ 16470: +/***/ 44021: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=eventNotificationSubscription.js.map +//# sourceMappingURL=workerPoolsSummaryResource.js.map /***/ }), -/***/ 50710: +/***/ 31613: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=eventNotificationSubscriptionFilter.js.map +//# sourceMappingURL=workerPoolsSupportedTypesResource.js.map /***/ }), -/***/ 27811: +/***/ 17678: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=eventResource.js.map +//# sourceMappingURL=workerToolsLatestImages.js.map /***/ }), -/***/ 82718: -/***/ ((__unused_webpack_module, exports) => { +/***/ 14812: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +module.exports = +{ + parallel : __nccwpck_require__(8210), + serial : __nccwpck_require__(50445), + serialOrdered : __nccwpck_require__(3578) +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=extensionSettingsValues.js.map /***/ }), -/***/ 62851: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1700: +/***/ ((module) => { -"use strict"; +// API +module.exports = abort; + +/** + * Aborts leftover active jobs + * + * @param {object} state - current state object + */ +function abort(state) +{ + Object.keys(state.jobs).forEach(clean.bind(state)); + + // reset leftover jobs + state.jobs = {}; +} + +/** + * Cleans up leftover job by invoking abort function for the provided job id + * + * @this state + * @param {string|number} key - job id to abort + */ +function clean(key) +{ + if (typeof this.jobs[key] == 'function') + { + this.jobs[key](); + } +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=extensionsInfoResource.js.map /***/ }), -/***/ 28075: -/***/ ((__unused_webpack_module, exports) => { +/***/ 72794: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var defer = __nccwpck_require__(15295); + +// API +module.exports = async; + +/** + * Runs provided callback asynchronously + * even if callback itself is not + * + * @param {function} callback - callback to invoke + * @returns {function} - augmented callback + */ +function async(callback) +{ + var isAsync = false; + + // check if async happened + defer(function() { isAsync = true; }); + + return function async_callback(err, result) + { + if (isAsync) + { + callback(err, result); + } + else + { + defer(function nextTick_callback() + { + callback(err, result); + }); + } + }; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=externalSecurityGroupProviderResource.js.map /***/ }), -/***/ 42769: -/***/ ((__unused_webpack_module, exports) => { +/***/ 15295: +/***/ ((module) => { -"use strict"; +module.exports = defer; + +/** + * Runs provided function on next iteration of the event loop + * + * @param {function} fn - function to run + */ +function defer(fn) +{ + var nextTick = typeof setImmediate == 'function' + ? setImmediate + : ( + typeof process == 'object' && typeof process.nextTick == 'function' + ? process.nextTick + : null + ); + + if (nextTick) + { + nextTick(fn); + } + else + { + setTimeout(fn, 0); + } +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=featuresConfigurationResource.js.map /***/ }), -/***/ 37877: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 9023: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var async = __nccwpck_require__(72794) + , abort = __nccwpck_require__(1700) + ; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getFeedTypeLabel = exports.isContainerImageRegistry = exports.containerRegistryFeedTypes = exports.isOctopusProjectFeed = exports.feedTypeSupportsExtraction = exports.feedTypeCanSearchEmpty = void 0; -var feedType_1 = __nccwpck_require__(30090); -var lodash_1 = __nccwpck_require__(90250); -function feedTypeCanSearchEmpty(feed) { - return ![ - feedType_1.FeedType.Docker, - feedType_1.FeedType.AwsElasticContainerRegistry, - feedType_1.FeedType.Maven, - feedType_1.FeedType.GitHub, - ].includes(feed); +// API +module.exports = iterate; + +/** + * Iterates over each job object + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {object} state - current job status + * @param {function} callback - invoked when all elements processed + */ +function iterate(list, iterator, state, callback) +{ + // store current index + var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; + + state.jobs[key] = runJob(iterator, key, list[key], function(error, output) + { + // don't repeat yourself + // skip secondary callbacks + if (!(key in state.jobs)) + { + return; + } + + // clean up jobs + delete state.jobs[key]; + + if (error) + { + // don't process rest of the results + // stop still active jobs + // and reset the list + abort(state); + } + else + { + state.results[key] = output; + } + + // return salvaged results + callback(error, state.results); + }); } -exports.feedTypeCanSearchEmpty = feedTypeCanSearchEmpty; -function feedTypeSupportsExtraction(feed) { - return ![feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry].includes(feed); + +/** + * Runs iterator over provided job element + * + * @param {function} iterator - iterator to invoke + * @param {string|number} key - key/index of the element in the list of jobs + * @param {mixed} item - job description + * @param {function} callback - invoked after iterator is done with the job + * @returns {function|mixed} - job abort function or something else + */ +function runJob(iterator, key, item, callback) +{ + var aborter; + + // allow shortcut if iterator expects only two arguments + if (iterator.length == 2) + { + aborter = iterator(item, async(callback)); + } + // otherwise go with full three arguments + else + { + aborter = iterator(item, key, async(callback)); + } + + return aborter; } -exports.feedTypeSupportsExtraction = feedTypeSupportsExtraction; -function isOctopusProjectFeed(feed) { - return feed === "OctopusProject"; + + +/***/ }), + +/***/ 42474: +/***/ ((module) => { + +// API +module.exports = state; + +/** + * Creates initial state object + * for iteration over list + * + * @param {array|object} list - list to iterate over + * @param {function|null} sortMethod - function to use for keys sort, + * or `null` to keep them as is + * @returns {object} - initial state object + */ +function state(list, sortMethod) +{ + var isNamedList = !Array.isArray(list) + , initState = + { + index : 0, + keyedList: isNamedList || sortMethod ? Object.keys(list) : null, + jobs : {}, + results : isNamedList ? {} : [], + size : isNamedList ? Object.keys(list).length : list.length + } + ; + + if (sortMethod) + { + // sort array keys based on it's values + // sort object's keys just on own merit + initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) + { + return sortMethod(list[a], list[b]); + }); + } + + return initState; } -exports.isOctopusProjectFeed = isOctopusProjectFeed; -function containerRegistryFeedTypes() { - return [feedType_1.FeedType.Docker, feedType_1.FeedType.AwsElasticContainerRegistry]; + + +/***/ }), + +/***/ 37942: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var abort = __nccwpck_require__(1700) + , async = __nccwpck_require__(72794) + ; + +// API +module.exports = terminator; + +/** + * Terminates jobs in the attached state context + * + * @this AsyncKitState# + * @param {function} callback - final callback to invoke after termination + */ +function terminator(callback) +{ + if (!Object.keys(this.jobs).length) + { + return; + } + + // fast forward iteration index + this.index = this.size; + + // abort jobs + abort(this); + + // send back results we have so far + async(callback)(null, this.results); } -exports.containerRegistryFeedTypes = containerRegistryFeedTypes; -function isContainerImageRegistry(feed) { - return containerRegistryFeedTypes().includes(feed); + + +/***/ }), + +/***/ 8210: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var iterate = __nccwpck_require__(9023) + , initState = __nccwpck_require__(42474) + , terminator = __nccwpck_require__(37942) + ; + +// Public API +module.exports = parallel; + +/** + * Runs iterator over provided array elements in parallel + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function parallel(list, iterator, callback) +{ + var state = initState(list); + + while (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, function(error, result) + { + if (error) + { + callback(error, result); + return; + } + + // looks like it's the last one + if (Object.keys(state.jobs).length === 0) + { + callback(null, state.results); + return; + } + }); + + state.index++; + } + + return terminator.bind(state, callback); } -exports.isContainerImageRegistry = isContainerImageRegistry; -var getFeedTypeLabel = function (feedType) { - var requiresContainerImageRegistryFeed = feedType && - feedType.length >= 1 && - (0, lodash_1.every)(feedType, function (f) { return isContainerImageRegistry(f); }); - var requiresHelmChartFeed = feedType && feedType.length === 1 && feedType[0] === feedType_1.FeedType.Helm; - if (requiresContainerImageRegistryFeed) { - return "Container Image Registry"; - } - if (requiresHelmChartFeed) { - return "Helm Chart Repository"; - } - return "Package"; -}; -exports.getFeedTypeLabel = getFeedTypeLabel; -//# sourceMappingURL=feedResource.js.map + /***/ }), -/***/ 30090: -/***/ ((__unused_webpack_module, exports) => { +/***/ 50445: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var serialOrdered = __nccwpck_require__(3578); + +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FeedType = void 0; -var FeedType; -(function (FeedType) { - FeedType["AwsElasticContainerRegistry"] = "AwsElasticContainerRegistry"; - FeedType["BuiltIn"] = "BuiltIn"; - FeedType["Docker"] = "Docker"; - FeedType["GitHub"] = "GitHub"; - FeedType["Helm"] = "Helm"; - FeedType["Maven"] = "Maven"; - FeedType["Nuget"] = "NuGet"; - FeedType["OctopusProject"] = "OctopusProject"; -})(FeedType = exports.FeedType || (exports.FeedType = {})); -//# sourceMappingURL=feedType.js.map /***/ }), -/***/ 24542: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3578: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var iterate = __nccwpck_require__(9023) + , initState = __nccwpck_require__(42474) + , terminator = __nccwpck_require__(37942) + ; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewGoogleCloudAccount = void 0; -var accountType_1 = __nccwpck_require__(34914); -function NewGoogleCloudAccount(name, jsonKey) { - return { - AccountType: accountType_1.AccountType.GoogleCloudAccount, - JsonKey: jsonKey, - Name: name, - }; +// Public API +module.exports = serialOrdered; +// sorting helpers +module.exports.ascending = ascending; +module.exports.descending = descending; + +/** + * Runs iterator over provided sorted array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} sortMethod - custom sort function + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serialOrdered(list, iterator, sortMethod, callback) +{ + var state = initState(list, sortMethod); + + iterate(list, iterator, state, function iteratorHandler(error, result) + { + if (error) + { + callback(error, result); + return; + } + + state.index++; + + // are we there yet? + if (state.index < (state['keyedList'] || list).length) + { + iterate(list, iterator, state, iteratorHandler); + return; + } + + // done here + callback(null, state.results); + }); + + return terminator.bind(state, callback); +} + +/* + * -- Sort methods + */ + +/** + * sort helper to sort array elements in ascending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function ascending(a, b) +{ + return a < b ? -1 : a > b ? 1 : 0; +} + +/** + * sort helper to sort array elements in descending order + * + * @param {mixed} a - an item to compare + * @param {mixed} b - an item to compare + * @returns {number} - comparison result + */ +function descending(a, b) +{ + return -1 * ascending(a, b); } -exports.NewGoogleCloudAccount = NewGoogleCloudAccount; -//# sourceMappingURL=googleCloudAccountResource.js.map -/***/ }), -/***/ 32471: -/***/ ((__unused_webpack_module, exports) => { +/***/ }), -"use strict"; +/***/ 96545: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=identityMetadataResource.js.map +module.exports = __nccwpck_require__(52618); /***/ }), -/***/ 20366: -/***/ ((__unused_webpack_module, exports) => { +/***/ 68104: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=identityResource.js.map -/***/ }), +var utils = __nccwpck_require__(20328); +var settle = __nccwpck_require__(13211); +var buildFullPath = __nccwpck_require__(41934); +var buildURL = __nccwpck_require__(30646); +var http = __nccwpck_require__(13685); +var https = __nccwpck_require__(95687); +var httpFollow = (__nccwpck_require__(67707).http); +var httpsFollow = (__nccwpck_require__(67707).https); +var url = __nccwpck_require__(57310); +var zlib = __nccwpck_require__(59796); +var VERSION = (__nccwpck_require__(94322).version); +var transitionalDefaults = __nccwpck_require__(40936); +var AxiosError = __nccwpck_require__(72093); +var CanceledError = __nccwpck_require__(34098); -/***/ 60157: -/***/ ((__unused_webpack_module, exports) => { +var isHttps = /https:?/; -"use strict"; +var supportedProtocols = [ 'http:', 'https:', 'file:' ]; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IdentityType = void 0; -var IdentityType; -(function (IdentityType) { - IdentityType[IdentityType["Guest"] = 0] = "Guest"; - IdentityType[IdentityType["UsernamePassword"] = 1] = "UsernamePassword"; - IdentityType[IdentityType["ActiveDirectory"] = 2] = "ActiveDirectory"; - IdentityType[IdentityType["OAuth"] = 3] = "OAuth"; -})(IdentityType = exports.IdentityType || (exports.IdentityType = {})); -//# sourceMappingURL=identityType.js.map +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; -/***/ }), + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } -/***/ 74561: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} -"use strict"; +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } } - Object.defineProperty(o, k2, desc); -}) : (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); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(21843), exports); -__exportStar(__nccwpck_require__(88253), exports); -__exportStar(__nccwpck_require__(35608), exports); -__exportStar(__nccwpck_require__(34914), exports); -__exportStar(__nccwpck_require__(6687), exports); -__exportStar(__nccwpck_require__(7689), exports); -__exportStar(__nccwpck_require__(9801), exports); -__exportStar(__nccwpck_require__(71517), exports); -__exportStar(__nccwpck_require__(6531), exports); -__exportStar(__nccwpck_require__(30597), exports); -__exportStar(__nccwpck_require__(10136), exports); -__exportStar(__nccwpck_require__(9947), exports); -__exportStar(__nccwpck_require__(48998), exports); -__exportStar(__nccwpck_require__(47799), exports); -__exportStar(__nccwpck_require__(34440), exports); -__exportStar(__nccwpck_require__(49241), exports); -__exportStar(__nccwpck_require__(53132), exports); -__exportStar(__nccwpck_require__(56543), exports); -__exportStar(__nccwpck_require__(40407), exports); -__exportStar(__nccwpck_require__(99710), exports); -__exportStar(__nccwpck_require__(34926), exports); -__exportStar(__nccwpck_require__(80778), exports); -__exportStar(__nccwpck_require__(94582), exports); -__exportStar(__nccwpck_require__(30939), exports); -__exportStar(__nccwpck_require__(18304), exports); -__exportStar(__nccwpck_require__(58502), exports); -__exportStar(__nccwpck_require__(16089), exports); -__exportStar(__nccwpck_require__(38639), exports); -__exportStar(__nccwpck_require__(72866), exports); -__exportStar(__nccwpck_require__(64699), exports); -__exportStar(__nccwpck_require__(39349), exports); -__exportStar(__nccwpck_require__(92669), exports); -__exportStar(__nccwpck_require__(27134), exports); -__exportStar(__nccwpck_require__(66707), exports); -__exportStar(__nccwpck_require__(27673), exports); -__exportStar(__nccwpck_require__(60035), exports); -__exportStar(__nccwpck_require__(91173), exports); -__exportStar(__nccwpck_require__(42969), exports); -__exportStar(__nccwpck_require__(33477), exports); -__exportStar(__nccwpck_require__(39021), exports); -__exportStar(__nccwpck_require__(50699), exports); -__exportStar(__nccwpck_require__(94840), exports); -__exportStar(__nccwpck_require__(18754), exports); -__exportStar(__nccwpck_require__(90097), exports); -__exportStar(__nccwpck_require__(52739), exports); -__exportStar(__nccwpck_require__(78766), exports); -__exportStar(__nccwpck_require__(21303), exports); -__exportStar(__nccwpck_require__(3712), exports); -__exportStar(__nccwpck_require__(27734), exports); -__exportStar(__nccwpck_require__(19170), exports); -__exportStar(__nccwpck_require__(99930), exports); -__exportStar(__nccwpck_require__(42546), exports); -__exportStar(__nccwpck_require__(83382), exports); -__exportStar(__nccwpck_require__(20006), exports); -__exportStar(__nccwpck_require__(26289), exports); -__exportStar(__nccwpck_require__(64543), exports); -__exportStar(__nccwpck_require__(88640), exports); -__exportStar(__nccwpck_require__(21706), exports); -__exportStar(__nccwpck_require__(65120), exports); -__exportStar(__nccwpck_require__(60599), exports); -__exportStar(__nccwpck_require__(61676), exports); -__exportStar(__nccwpck_require__(71615), exports); -__exportStar(__nccwpck_require__(26994), exports); -__exportStar(__nccwpck_require__(40633), exports); -__exportStar(__nccwpck_require__(157), exports); -__exportStar(__nccwpck_require__(71976), exports); -__exportStar(__nccwpck_require__(81741), exports); -__exportStar(__nccwpck_require__(10322), exports); -__exportStar(__nccwpck_require__(9042), exports); -__exportStar(__nccwpck_require__(95369), exports); -__exportStar(__nccwpck_require__(48798), exports); -__exportStar(__nccwpck_require__(67788), exports); -__exportStar(__nccwpck_require__(69297), exports); -__exportStar(__nccwpck_require__(33162), exports); -__exportStar(__nccwpck_require__(91606), exports); -__exportStar(__nccwpck_require__(85284), exports); -__exportStar(__nccwpck_require__(36747), exports); -__exportStar(__nccwpck_require__(34830), exports); -__exportStar(__nccwpck_require__(93373), exports); -__exportStar(__nccwpck_require__(34042), exports); -__exportStar(__nccwpck_require__(31719), exports); -__exportStar(__nccwpck_require__(47479), exports); -__exportStar(__nccwpck_require__(78157), exports); -__exportStar(__nccwpck_require__(16470), exports); -__exportStar(__nccwpck_require__(50710), exports); -__exportStar(__nccwpck_require__(27811), exports); -__exportStar(__nccwpck_require__(82718), exports); -__exportStar(__nccwpck_require__(62851), exports); -__exportStar(__nccwpck_require__(28075), exports); -__exportStar(__nccwpck_require__(42769), exports); -__exportStar(__nccwpck_require__(37877), exports); -__exportStar(__nccwpck_require__(30090), exports); -__exportStar(__nccwpck_require__(24542), exports); -__exportStar(__nccwpck_require__(32471), exports); -__exportStar(__nccwpck_require__(20366), exports); -__exportStar(__nccwpck_require__(60157), exports); -__exportStar(__nccwpck_require__(5639), exports); -__exportStar(__nccwpck_require__(90938), exports); -__exportStar(__nccwpck_require__(56196), exports); -__exportStar(__nccwpck_require__(17700), exports); -__exportStar(__nccwpck_require__(3753), exports); -__exportStar(__nccwpck_require__(44688), exports); -__exportStar(__nccwpck_require__(32925), exports); -__exportStar(__nccwpck_require__(27467), exports); -__exportStar(__nccwpck_require__(82025), exports); -__exportStar(__nccwpck_require__(80464), exports); -__exportStar(__nccwpck_require__(92262), exports); -__exportStar(__nccwpck_require__(55847), exports); -__exportStar(__nccwpck_require__(92803), exports); -__exportStar(__nccwpck_require__(97218), exports); -__exportStar(__nccwpck_require__(54085), exports); -__exportStar(__nccwpck_require__(64605), exports); -__exportStar(__nccwpck_require__(95545), exports); -__exportStar(__nccwpck_require__(73927), exports); -__exportStar(__nccwpck_require__(57636), exports); -__exportStar(__nccwpck_require__(93176), exports); -__exportStar(__nccwpck_require__(72150), exports); -__exportStar(__nccwpck_require__(82705), exports); -__exportStar(__nccwpck_require__(59827), exports); -__exportStar(__nccwpck_require__(42463), exports); -__exportStar(__nccwpck_require__(51865), exports); -__exportStar(__nccwpck_require__(52939), exports); -__exportStar(__nccwpck_require__(22110), exports); -__exportStar(__nccwpck_require__(65688), exports); -__exportStar(__nccwpck_require__(72151), exports); -__exportStar(__nccwpck_require__(48920), exports); -__exportStar(__nccwpck_require__(84328), exports); -__exportStar(__nccwpck_require__(58858), exports); -__exportStar(__nccwpck_require__(81935), exports); -__exportStar(__nccwpck_require__(81286), exports); -__exportStar(__nccwpck_require__(12358), exports); -__exportStar(__nccwpck_require__(14239), exports); -__exportStar(__nccwpck_require__(17929), exports); -__exportStar(__nccwpck_require__(2847), exports); -__exportStar(__nccwpck_require__(50671), exports); -__exportStar(__nccwpck_require__(37648), exports); -__exportStar(__nccwpck_require__(35882), exports); -__exportStar(__nccwpck_require__(89010), exports); -__exportStar(__nccwpck_require__(66933), exports); -__exportStar(__nccwpck_require__(20928), exports); -__exportStar(__nccwpck_require__(79856), exports); -__exportStar(__nccwpck_require__(15259), exports); -__exportStar(__nccwpck_require__(60651), exports); -__exportStar(__nccwpck_require__(49346), exports); -__exportStar(__nccwpck_require__(54710), exports); -__exportStar(__nccwpck_require__(81148), exports); -__exportStar(__nccwpck_require__(32771), exports); -__exportStar(__nccwpck_require__(29703), exports); -__exportStar(__nccwpck_require__(70913), exports); -__exportStar(__nccwpck_require__(47875), exports); -__exportStar(__nccwpck_require__(62054), exports); -__exportStar(__nccwpck_require__(29029), exports); -__exportStar(__nccwpck_require__(95699), exports); -__exportStar(__nccwpck_require__(55795), exports); -__exportStar(__nccwpck_require__(24196), exports); -__exportStar(__nccwpck_require__(86630), exports); -__exportStar(__nccwpck_require__(70634), exports); -__exportStar(__nccwpck_require__(89763), exports); -__exportStar(__nccwpck_require__(97446), exports); -__exportStar(__nccwpck_require__(91535), exports); -__exportStar(__nccwpck_require__(40903), exports); -__exportStar(__nccwpck_require__(28620), exports); -__exportStar(__nccwpck_require__(13627), exports); -__exportStar(__nccwpck_require__(35168), exports); -__exportStar(__nccwpck_require__(43924), exports); -__exportStar(__nccwpck_require__(65898), exports); -__exportStar(__nccwpck_require__(91699), exports); -__exportStar(__nccwpck_require__(33437), exports); -__exportStar(__nccwpck_require__(97610), exports); -__exportStar(__nccwpck_require__(80014), exports); -__exportStar(__nccwpck_require__(25462), exports); -__exportStar(__nccwpck_require__(93411), exports); -__exportStar(__nccwpck_require__(22245), exports); -__exportStar(__nccwpck_require__(40496), exports); -__exportStar(__nccwpck_require__(42338), exports); -__exportStar(__nccwpck_require__(95297), exports); -__exportStar(__nccwpck_require__(96286), exports); -__exportStar(__nccwpck_require__(63216), exports); -__exportStar(__nccwpck_require__(98411), exports); -__exportStar(__nccwpck_require__(36029), exports); -__exportStar(__nccwpck_require__(5899), exports); -__exportStar(__nccwpck_require__(11400), exports); -__exportStar(__nccwpck_require__(26571), exports); -__exportStar(__nccwpck_require__(19891), exports); -__exportStar(__nccwpck_require__(82034), exports); -__exportStar(__nccwpck_require__(77703), exports); -__exportStar(__nccwpck_require__(47106), exports); -__exportStar(__nccwpck_require__(34703), exports); -__exportStar(__nccwpck_require__(24223), exports); -__exportStar(__nccwpck_require__(71606), exports); -__exportStar(__nccwpck_require__(63390), exports); -__exportStar(__nccwpck_require__(19038), exports); -__exportStar(__nccwpck_require__(39849), exports); -__exportStar(__nccwpck_require__(24752), exports); -__exportStar(__nccwpck_require__(54000), exports); -__exportStar(__nccwpck_require__(93704), exports); -__exportStar(__nccwpck_require__(49281), exports); -__exportStar(__nccwpck_require__(20114), exports); -__exportStar(__nccwpck_require__(93060), exports); -__exportStar(__nccwpck_require__(32196), exports); -__exportStar(__nccwpck_require__(82342), exports); -__exportStar(__nccwpck_require__(66197), exports); -__exportStar(__nccwpck_require__(95317), exports); -__exportStar(__nccwpck_require__(64507), exports); -__exportStar(__nccwpck_require__(26498), exports); -__exportStar(__nccwpck_require__(10171), exports); -__exportStar(__nccwpck_require__(37396), exports); -__exportStar(__nccwpck_require__(22152), exports); -__exportStar(__nccwpck_require__(33543), exports); -__exportStar(__nccwpck_require__(94565), exports); -__exportStar(__nccwpck_require__(32841), exports); -__exportStar(__nccwpck_require__(57461), exports); -__exportStar(__nccwpck_require__(24458), exports); -__exportStar(__nccwpck_require__(75507), exports); -__exportStar(__nccwpck_require__(42857), exports); -__exportStar(__nccwpck_require__(19863), exports); -__exportStar(__nccwpck_require__(50606), exports); -__exportStar(__nccwpck_require__(65252), exports); -__exportStar(__nccwpck_require__(51140), exports); -__exportStar(__nccwpck_require__(38664), exports); -__exportStar(__nccwpck_require__(44990), exports); -__exportStar(__nccwpck_require__(30874), exports); -__exportStar(__nccwpck_require__(87516), exports); -__exportStar(__nccwpck_require__(84199), exports); -__exportStar(__nccwpck_require__(84955), exports); -__exportStar(__nccwpck_require__(36445), exports); -__exportStar(__nccwpck_require__(20736), exports); -__exportStar(__nccwpck_require__(54797), exports); -__exportStar(__nccwpck_require__(68517), exports); -__exportStar(__nccwpck_require__(31113), exports); -__exportStar(__nccwpck_require__(67683), exports); -__exportStar(__nccwpck_require__(77693), exports); -__exportStar(__nccwpck_require__(70229), exports); -__exportStar(__nccwpck_require__(34170), exports); -__exportStar(__nccwpck_require__(58574), exports); -__exportStar(__nccwpck_require__(1033), exports); -__exportStar(__nccwpck_require__(30292), exports); -__exportStar(__nccwpck_require__(78010), exports); -__exportStar(__nccwpck_require__(54638), exports); -__exportStar(__nccwpck_require__(41823), exports); -__exportStar(__nccwpck_require__(69838), exports); -__exportStar(__nccwpck_require__(54861), exports); -__exportStar(__nccwpck_require__(45206), exports); -__exportStar(__nccwpck_require__(36604), exports); -__exportStar(__nccwpck_require__(50872), exports); -__exportStar(__nccwpck_require__(24456), exports); -__exportStar(__nccwpck_require__(7151), exports); -__exportStar(__nccwpck_require__(90269), exports); -__exportStar(__nccwpck_require__(32280), exports); -__exportStar(__nccwpck_require__(36186), exports); -__exportStar(__nccwpck_require__(71879), exports); -__exportStar(__nccwpck_require__(71283), exports); -__exportStar(__nccwpck_require__(63823), exports); -__exportStar(__nccwpck_require__(94620), exports); -__exportStar(__nccwpck_require__(82668), exports); -__exportStar(__nccwpck_require__(24090), exports); -__exportStar(__nccwpck_require__(3282), exports); -__exportStar(__nccwpck_require__(99028), exports); -__exportStar(__nccwpck_require__(44021), exports); -__exportStar(__nccwpck_require__(31613), exports); -__exportStar(__nccwpck_require__(48773), exports); -__exportStar(__nccwpck_require__(51578), exports); -__exportStar(__nccwpck_require__(30742), exports); -__exportStar(__nccwpck_require__(17678), exports); -__exportStar(__nccwpck_require__(51496), exports); -//# sourceMappingURL=index.js.map + var resolve = function resolve(value) { + done(); + resolvePromise(value); + }; + var rejected = false; + var reject = function reject(value) { + done(); + rejected = true; + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; + var headerNames = {}; -/***/ }), + Object.keys(headers).forEach(function storeLowerName(name) { + headerNames[name.toLowerCase()] = name; + }); -/***/ 5639: -/***/ ((__unused_webpack_module, exports) => { + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('user-agent' in headerNames) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers[headerNames['user-agent']]) { + delete headers[headerNames['user-agent']]; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + VERSION; + } -"use strict"; + // support for https://www.npmjs.com/package/form-data api + if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { + Object.assign(headers, data.getHeaders()); + } else if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(new AxiosError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + AxiosError.ERR_BAD_REQUEST, + config + )); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=interruptionResource.js.map + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(new AxiosError( + 'Request body larger than maxBodyLength limit', + AxiosError.ERR_BAD_REQUEST, + config + )); + } -/***/ }), + // Add Content-Length header if data exists + if (!headerNames['content-length']) { + headers['Content-Length'] = data.length; + } + } -/***/ 90938: -/***/ ((__unused_webpack_module, exports) => { + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } -"use strict"; + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || supportedProtocols[0]; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=invitationResource.js.map + if (supportedProtocols.indexOf(protocol) === -1) { + return reject(new AxiosError( + 'Unsupported protocol ' + protocol, + AxiosError.ERR_BAD_REQUEST, + config + )); + } -/***/ }), + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } -/***/ 56196: -/***/ ((__unused_webpack_module, exports) => { + if (auth && headerNames.authorization) { + delete headers[headerNames.authorization]; + } -"use strict"; + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.KubernetesAuthenticationType = void 0; -var KubernetesAuthenticationType; -(function (KubernetesAuthenticationType) { - KubernetesAuthenticationType["KubernetesAws"] = "KubernetesAws"; - KubernetesAuthenticationType["KubernetesAzure"] = "KubernetesAzure"; - KubernetesAuthenticationType["KubernetesCertificate"] = "KubernetesCertificate"; - KubernetesAuthenticationType["KubernetesGoogleCloud"] = "KubernetesGoogleCloud"; - KubernetesAuthenticationType["KubernetesPodServiceAccount"] = "KubernetesPodService"; - KubernetesAuthenticationType["KubernetesStandard"] = "KubernetesStandard"; -})(KubernetesAuthenticationType = exports.KubernetesAuthenticationType || (exports.KubernetesAuthenticationType = {})); -//# sourceMappingURL=kubernetesAuthenticationType.js.map + try { + buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''); + } catch (err) { + var customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + reject(customErr); + } -/***/ }), + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; -/***/ 17700: -/***/ ((__unused_webpack_module, exports) => { + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } -"use strict"; + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=letsEncryptConfigurationResource.js.map + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); -/***/ }), + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } -/***/ 3753: -/***/ ((__unused_webpack_module, exports) => { + return parsed.hostname === proxyElement; + }); + } -"use strict"; + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=libraryVariableSetResource.js.map + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } -/***/ }), + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } -/***/ 44688: -/***/ ((__unused_webpack_module, exports) => { + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + if (config.beforeRedirect) { + options.beforeRedirect = config.beforeRedirect; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } -"use strict"; + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=libraryVariableSetUsageEntry.js.map + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } -/***/ }), + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; -/***/ 32925: -/***/ ((__unused_webpack_module, exports) => { + // uncompress the response body transparently if required + var stream = res; -"use strict"; + // return the last request in case of redirects + var lastRequest = res.req || req; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=libraryVariableSetUsageResource.js.map -/***/ }), + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); -/***/ 27467: -/***/ ((__unused_webpack_module, exports) => { + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } -"use strict"; + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=licenseResource.js.map + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; -/***/ }), + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + // stream.destoy() emit aborted event before calling reject() on Node.js v16 + rejected = true; + stream.destroy(); + reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + } + }); -/***/ 82025: -/***/ ((__unused_webpack_module, exports) => { + stream.on('aborted', function handlerStreamAborted() { + if (rejected) { + return; + } + stream.destroy(); + reject(new AxiosError( + 'maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + )); + }); -"use strict"; + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(AxiosError.from(err, null, config, lastRequest)); + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LicenseMessageDisposition = exports.PermissionsMode = exports.HostingEnvironment = void 0; -var HostingEnvironment; -(function (HostingEnvironment) { - HostingEnvironment["SelfHosted"] = "SelfHosted"; - HostingEnvironment["OctopusCloud"] = "OctopusCloud"; -})(HostingEnvironment = exports.HostingEnvironment || (exports.HostingEnvironment = {})); -var PermissionsMode; -(function (PermissionsMode) { - PermissionsMode["Unspecified"] = "Unspecified"; - PermissionsMode["Restricted"] = "Restricted"; - PermissionsMode["Full"] = "Full"; -})(PermissionsMode = exports.PermissionsMode || (exports.PermissionsMode = {})); -var LicenseMessageDisposition; -(function (LicenseMessageDisposition) { - LicenseMessageDisposition["Information"] = "Information"; - LicenseMessageDisposition["Warning"] = "Warning"; - LicenseMessageDisposition["Error"] = "Error"; -})(LicenseMessageDisposition = exports.LicenseMessageDisposition || (exports.LicenseMessageDisposition = {})); -//# sourceMappingURL=licenseStatusResource.js.map + stream.on('end', function handleStreamEnd() { + try { + var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + reject(AxiosError.from(err, null, config, response.request, response)); + } + settle(resolve, reject, response); + }); + } + }); -/***/ }), + // Handle errors + req.on('error', function handleRequestError(err) { + // @todo remove + // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; + reject(AxiosError.from(err, null, config, req)); + }); -/***/ 80464: -/***/ ((__unused_webpack_module, exports) => { + // set tcp keep alive to prevent drop connection by peer + req.on('socket', function handleRequestSocket(socket) { + // default interval of sending ack packet is 1 minute + socket.setKeepAlive(true, 1000 * 60); + }); -"use strict"; + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=lifecycleProgressionResource.js.map + if (isNaN(timeout)) { + reject(new AxiosError( + 'error trying to parse `config.timeout` to int', + AxiosError.ERR_BAD_OPTION_VALUE, + config, + req + )); -/***/ }), + return; + } -/***/ 92262: -/***/ ((__unused_webpack_module, exports) => { + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + var transitional = config.transitional || transitionalDefaults; + reject(new AxiosError( + 'timeout of ' + timeout + 'ms exceeded', + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + req + )); + }); + } -"use strict"; + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function(cancel) { + if (req.aborted) return; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=lifecycleResource.js.map + req.abort(); + reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); + }; -/***/ }), + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } -/***/ 55847: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(AxiosError.from(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); + } + }); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=linksCollection.js.map /***/ }), -/***/ 92803: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3454: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=loginCommand.js.map -/***/ }), +var utils = __nccwpck_require__(20328); +var settle = __nccwpck_require__(13211); +var cookies = __nccwpck_require__(21545); +var buildURL = __nccwpck_require__(30646); +var buildFullPath = __nccwpck_require__(41934); +var parseHeaders = __nccwpck_require__(86455); +var isURLSameOrigin = __nccwpck_require__(33608); +var transitionalDefaults = __nccwpck_require__(40936); +var AxiosError = __nccwpck_require__(72093); +var CanceledError = __nccwpck_require__(34098); +var parseProtocol = __nccwpck_require__(66107); -/***/ 97218: -/***/ ((__unused_webpack_module, exports) => { +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } -"use strict"; + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=loginInitiatedResource.js.map + if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) { + delete requestHeaders['Content-Type']; // Let the browser set it + } -/***/ }), + var request = new XMLHttpRequest(); -/***/ 54085: -/***/ ((__unused_webpack_module, exports) => { + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } -"use strict"; + var fullPath = buildFullPath(config.baseURL, config.url); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=loginState.js.map + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); -/***/ }), + // Set the request timeout in MS + request.timeout = config.timeout; -/***/ 64605: -/***/ ((__unused_webpack_module, exports) => { + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; -"use strict"; + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DeleteMachinesBehavior = void 0; -var DeleteMachinesBehavior; -(function (DeleteMachinesBehavior) { - DeleteMachinesBehavior["DoNotDelete"] = "DoNotDelete"; - DeleteMachinesBehavior["DeleteUnavailableMachines"] = "DeleteUnavailableMachines"; -})(DeleteMachinesBehavior = exports.DeleteMachinesBehavior || (exports.DeleteMachinesBehavior = {})); -//# sourceMappingURL=machineCleanupPolicy.js.map + // Clean up request + request = null; + } -/***/ }), + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } -/***/ 95545: -/***/ ((__unused_webpack_module, exports) => { + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } -"use strict"; + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=machineConnectionStatus.js.map + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); -/***/ }), + // Clean up request + request = null; + }; -/***/ 73927: -/***/ ((__unused_webpack_module, exports) => { + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request)); -"use strict"; + // Clean up request + request = null; + }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineConnectivityBehavior = void 0; -var MachineConnectivityBehavior; -(function (MachineConnectivityBehavior) { - MachineConnectivityBehavior["ExpectedToBeOnline"] = "ExpectedToBeOnline"; - MachineConnectivityBehavior["MayBeOfflineAndCanBeSkipped"] = "MayBeOfflineAndCanBeSkipped"; -})(MachineConnectivityBehavior = exports.MachineConnectivityBehavior || (exports.MachineConnectivityBehavior = {})); -//# sourceMappingURL=machineConnectivityPolicy.js.map + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + var transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); -/***/ }), + // Clean up request + request = null; + }; -/***/ 57636: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; -"use strict"; + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineFilterResource = void 0; -var triggerFilterResource_1 = __nccwpck_require__(1033); -var triggerFilterType_1 = __nccwpck_require__(30292); -var MachineFilterResource = (function (_super) { - __extends(MachineFilterResource, _super); - function MachineFilterResource() { - var _this = _super.call(this) || this; - _this.EnvironmentIds = undefined; - _this.Roles = undefined; - _this.EventGroups = undefined; - _this.EventCategories = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.MachineFilter; - return _this; + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); } - return MachineFilterResource; -}(triggerFilterResource_1.TriggerFilterResource)); -exports.MachineFilterResource = MachineFilterResource; -//# sourceMappingURL=machineFilterResource.js.map -/***/ }), + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } -/***/ 93176: -/***/ ((__unused_webpack_module, exports) => { + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } -"use strict"; + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HealthCheckType = void 0; -var HealthCheckType; -(function (HealthCheckType) { - HealthCheckType["RunScript"] = "RunScript"; - HealthCheckType["OnlyConnectivity"] = "OnlyConnectivity"; -})(HealthCheckType = exports.HealthCheckType || (exports.HealthCheckType = {})); -//# sourceMappingURL=machineHealthCheckPolicy.js.map + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } -/***/ }), + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function(cancel) { + if (!request) { + return; + } + reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); + request.abort(); + request = null; + }; -/***/ 72150: -/***/ ((__unused_webpack_module, exports) => { + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } -"use strict"; + if (!requestData) { + requestData = null; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=machinePolicyResource.js.map + var protocol = parseProtocol(fullPath); -/***/ }), + if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } -/***/ 82705: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; + // Send the request + request.send(requestData); + }); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MachineModelHealthStatus = exports.NewMachine = void 0; -function NewMachine(name, endpoint) { - return { - IsDisabled: false, - IsInProcess: false, - Endpoint: endpoint, - HealthStatus: MachineModelHealthStatus.Unknown, - Name: name, - HasLatestCalamari: false, - MachinePolicyId: "", - }; -} -exports.NewMachine = NewMachine; -var MachineModelHealthStatus; -(function (MachineModelHealthStatus) { - MachineModelHealthStatus["Healthy"] = "Healthy"; - MachineModelHealthStatus["Unavailable"] = "Unavailable"; - MachineModelHealthStatus["Unknown"] = "Unknown"; - MachineModelHealthStatus["HasWarnings"] = "HasWarnings"; - MachineModelHealthStatus["Unhealthy"] = "Unhealthy"; -})(MachineModelHealthStatus = exports.MachineModelHealthStatus || (exports.MachineModelHealthStatus = {})); -//# sourceMappingURL=machineResource.js.map /***/ }), -/***/ 59827: -/***/ ((__unused_webpack_module, exports) => { +/***/ 52618: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=machineScriptPolicy.js.map -/***/ }), +var utils = __nccwpck_require__(20328); +var bind = __nccwpck_require__(77065); +var Axios = __nccwpck_require__(98178); +var mergeConfig = __nccwpck_require__(74831); +var defaults = __nccwpck_require__(21626); -/***/ 42463: -/***/ ((__unused_webpack_module, exports) => { +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); -"use strict"; + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TentacleUpdateBehavior = exports.CalamariUpdateBehavior = void 0; -var CalamariUpdateBehavior; -(function (CalamariUpdateBehavior) { - CalamariUpdateBehavior["UpdateOnDeployment"] = "UpdateOnDeployment"; - CalamariUpdateBehavior["UpdateOnNewMachine"] = "UpdateOnNewMachine"; - CalamariUpdateBehavior["UpdateAlways"] = "UpdateAlways"; -})(CalamariUpdateBehavior = exports.CalamariUpdateBehavior || (exports.CalamariUpdateBehavior = {})); -var TentacleUpdateBehavior; -(function (TentacleUpdateBehavior) { - TentacleUpdateBehavior["NeverUpdate"] = "NeverUpdate"; - TentacleUpdateBehavior["Update"] = "Update"; -})(TentacleUpdateBehavior = exports.TentacleUpdateBehavior || (exports.TentacleUpdateBehavior = {})); -//# sourceMappingURL=machineUpdatePolicy.js.map + // Copy context to instance + utils.extend(instance, context); -/***/ }), + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; -/***/ 51865: -/***/ ((__unused_webpack_module, exports) => { + return instance; +} -"use strict"; +// Create the default instance to be exported +var axios = createInstance(defaults); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=maintenanceConfigurationResource.js.map +// Expose Axios class to allow class inheritance +axios.Axios = Axios; -/***/ }), +// Expose Cancel & CancelToken +axios.CanceledError = __nccwpck_require__(34098); +axios.CancelToken = __nccwpck_require__(71587); +axios.isCancel = __nccwpck_require__(64057); +axios.VERSION = (__nccwpck_require__(94322).version); +axios.toFormData = __nccwpck_require__(20470); -/***/ 52939: -/***/ ((__unused_webpack_module, exports) => { +// Expose AxiosError class +axios.AxiosError = __nccwpck_require__(72093); -"use strict"; +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=multiTenancyStatusResource.js.map +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __nccwpck_require__(74850); -/***/ }), +// Expose isAxiosError +axios.isAxiosError = __nccwpck_require__(60650); -/***/ 22110: -/***/ ((__unused_webpack_module, exports) => { +module.exports = axios; -"use strict"; +// Allow use of default import syntax in TypeScript +module.exports["default"] = axios; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=namedReferenceItem.js.map /***/ }), -/***/ 65688: -/***/ ((__unused_webpack_module, exports) => { +/***/ 71587: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=namedResource.js.map -/***/ }), +var CanceledError = __nccwpck_require__(34098); -/***/ 72151: -/***/ ((__unused_webpack_module, exports) => { +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } -"use strict"; + var resolvePromise; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=nonVcsRunbookResource.js.map + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); -/***/ }), + var token = this; -/***/ 48920: -/***/ (function(__unused_webpack_module, exports) { + // eslint-disable-next-line func-names + this.promise.then(function(cancel) { + if (!token._listeners) return; -"use strict"; + var i; + var l = token._listeners.length; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -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); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OctopusError = void 0; -var OctopusError = (function (_super) { - __extends(OctopusError, _super); - function OctopusError(StatusCode, message) { - var _this = _super.call(this, message) || this; - _this.StatusCode = StatusCode; - _this.ErrorMessage = message; - _this.Errors = []; - Object.setPrototypeOf(_this, OctopusError.prototype); - return _this; + for (i = 0; i < l; i++) { + token._listeners[i](cancel); } - OctopusError.create = function (statusCode, response) { - var e = new OctopusError(statusCode); - var n = __assign(__assign({}, e), response); - Object.setPrototypeOf(n, OctopusError.prototype); - return n; + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = function(onfulfilled) { + var _resolve; + // eslint-disable-next-line func-names + var promise = new Promise(function(resolve) { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); }; - return OctopusError; -}(Error)); -exports.OctopusError = OctopusError; -//# sourceMappingURL=octopusError.js.map -/***/ }), + return promise; + }; -/***/ 84328: -/***/ ((__unused_webpack_module, exports) => { + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } -"use strict"; + token.reason = new CanceledError(message); + resolvePromise(token.reason); + }); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusProjectFeedResource.js.map +/** + * Throws a `CanceledError` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; -/***/ }), +/** + * Subscribe to the cancel signal + */ -/***/ 58858: -/***/ ((__unused_webpack_module, exports) => { +CancelToken.prototype.subscribe = function subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } -"use strict"; + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusServerClusterSummaryResource.js.map +/** + * Unsubscribe from the cancel signal + */ -/***/ }), +CancelToken.prototype.unsubscribe = function unsubscribe(listener) { + if (!this._listeners) { + return; + } + var index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } +}; -/***/ 81935: -/***/ ((__unused_webpack_module, exports) => { +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; -"use strict"; +module.exports = CancelToken; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusServerNodeDetailsResource.js.map /***/ }), -/***/ 81286: -/***/ ((__unused_webpack_module, exports) => { +/***/ 34098: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusServerNodeResource.js.map -/***/ }), +var AxiosError = __nccwpck_require__(72093); +var utils = __nccwpck_require__(20328); -/***/ 12358: -/***/ ((__unused_webpack_module, exports) => { +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function CanceledError(message) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED); + this.name = 'CanceledError'; +} -"use strict"; +utils.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +module.exports = CanceledError; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=octopusServerNodeSummaryResource.js.map /***/ }), -/***/ 14239: -/***/ (function(__unused_webpack_module, exports) { +/***/ 64057: +/***/ ((module) => { "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); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createWarningsFromOctopusWarning = void 0; -function createWarningsFromOctopusWarning(warning) { - return { - message: warning.WarningMessage, - warnings: warning.Warnings || [], - parsedHelpLinks: warning.ParsedHelpLinks, - helpLink: warning.HelpLink, - helpText: warning.HelpText, - fieldWarnings: {}, - details: flattenWarningDetails(warning.Details), - }; -} -exports.createWarningsFromOctopusWarning = createWarningsFromOctopusWarning; -function joinWarningEntries(parentKey, entry) { - if (entry === void 0) { entry = {}; } - return Object.keys(entry).reduce(function (prev, key) { - var _a; - return (__assign(__assign({}, prev), (_a = {}, _a["".concat(parentKey, ":").concat(key)] = entry[key].join(", "), _a))); - }, {}); -} -function flattenWarningDetails(details) { - if (details === void 0) { details = {}; } - return Object.keys(details).reduce(function (prev, parentKey) { return (__assign(__assign({}, prev), joinWarningEntries(parentKey, details[parentKey]))); }, {}); -} -//# sourceMappingURL=octopusValidationResponse.js.map - -/***/ }), - -/***/ 17929: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=offlineDropDestinationResource.js.map /***/ }), -/***/ 2847: -/***/ ((__unused_webpack_module, exports) => { +/***/ 98178: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OfflineDropDestinationType = void 0; -var OfflineDropDestinationType; -(function (OfflineDropDestinationType) { - OfflineDropDestinationType["Artifact"] = "Artifact"; - OfflineDropDestinationType["FileSystem"] = "FileSystem"; -})(OfflineDropDestinationType = exports.OfflineDropDestinationType || (exports.OfflineDropDestinationType = {})); -//# sourceMappingURL=offlineDropDestinationType.js.map -/***/ }), +var utils = __nccwpck_require__(20328); +var buildURL = __nccwpck_require__(30646); +var InterceptorManager = __nccwpck_require__(3214); +var dispatchRequest = __nccwpck_require__(85062); +var mergeConfig = __nccwpck_require__(74831); +var buildFullPath = __nccwpck_require__(41934); +var validator = __nccwpck_require__(51632); -/***/ 50671: -/***/ ((__unused_webpack_module, exports) => { +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} -"use strict"; +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=onboardingResource.js.map + config = mergeConfig(this.defaults, config); -/***/ }), + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } -/***/ 37648: -/***/ ((__unused_webpack_module, exports) => { + var transitional = config.transitional; -"use strict"; + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageAcquisitionLocation = void 0; -var PackageAcquisitionLocation; -(function (PackageAcquisitionLocation) { - PackageAcquisitionLocation["Server"] = "Server"; - PackageAcquisitionLocation["ExecutionTarget"] = "ExecutionTarget"; - PackageAcquisitionLocation["NotAcquired"] = "NotAcquired"; -})(PackageAcquisitionLocation = exports.PackageAcquisitionLocation || (exports.PackageAcquisitionLocation = {})); -//# sourceMappingURL=packageAcquisitionLocation.js.map + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; -/***/ }), + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); -/***/ 35882: -/***/ ((__unused_webpack_module, exports) => { + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); -"use strict"; + var promise; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=packageDescriptionResource.js.map + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; -/***/ }), + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); -/***/ 89010: -/***/ ((__unused_webpack_module, exports) => { + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } -"use strict"; + return promise; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=packageFromBuiltInFeedResource.js.map -/***/ }), + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } -/***/ 66933: -/***/ ((__unused_webpack_module, exports) => { + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } -"use strict"; + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PackageSelectionMode = void 0; -var PackageSelectionMode; -(function (PackageSelectionMode) { - PackageSelectionMode["Immediate"] = "immediate"; - PackageSelectionMode["Deferred"] = "deferred"; -})(PackageSelectionMode = exports.PackageSelectionMode || (exports.PackageSelectionMode = {})); -//# sourceMappingURL=packageReference.js.map + return promise; +}; -/***/ }), +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + var fullPath = buildFullPath(config.baseURL, config.url); + return buildURL(fullPath, config.params, config.paramsSerializer); +}; -/***/ 20928: -/***/ ((__unused_webpack_module, exports) => { +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); -"use strict"; +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=packageResource.js.map + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url: url, + data: data + })); + }; + } -/***/ }), + Axios.prototype[method] = generateHTTPMethod(); -/***/ 79856: -/***/ ((__unused_webpack_module, exports) => { + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); -"use strict"; +module.exports = Axios; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=packageVersionResource.js.map /***/ }), -/***/ 15259: -/***/ ((__unused_webpack_module, exports) => { +/***/ 72093: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=pagingCollection.js.map - -/***/ }), - -/***/ 60651: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +var utils = __nccwpck_require__(20328); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DashboardRenderMode = void 0; -var DashboardRenderMode; -(function (DashboardRenderMode) { - DashboardRenderMode["VirtualizeColumns"] = "VirtualizeColumns"; - DashboardRenderMode["VirtualizeRowsAndColumns"] = "VirtualizeRowsAndColumns"; -})(DashboardRenderMode = exports.DashboardRenderMode || (exports.DashboardRenderMode = {})); -//# sourceMappingURL=performanceConfigurationResource.js.map +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + response && (this.response = response); +} -/***/ }), +utils.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + } +}); -/***/ 49346: -/***/ ((__unused_webpack_module, exports) => { +var prototype = AxiosError.prototype; +var descriptors = {}; -"use strict"; +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED' +// eslint-disable-next-line func-names +].forEach(function(code) { + descriptors[code] = {value: code}; +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Permission = void 0; -var Permission; -(function (Permission) { - Permission["None"] = "None"; - Permission["AccountCreate"] = "AccountCreate"; - Permission["AccountDelete"] = "AccountDelete"; - Permission["AccountEdit"] = "AccountEdit"; - Permission["AccountView"] = "AccountView"; - Permission["ActionTemplateCreate"] = "ActionTemplateCreate"; - Permission["ActionTemplateDelete"] = "ActionTemplateDelete"; - Permission["ActionTemplateEdit"] = "ActionTemplateEdit"; - Permission["ActionTemplateView"] = "ActionTemplateView"; - Permission["AdministerSystem"] = "AdministerSystem"; - Permission["ArtifactCreate"] = "ArtifactCreate"; - Permission["ArtifactDelete"] = "ArtifactDelete"; - Permission["ArtifactEdit"] = "ArtifactEdit"; - Permission["ArtifactView"] = "ArtifactView"; - Permission["BuildInformationAdminister"] = "BuildInformationAdminister"; - Permission["BuildInformationPush"] = "BuildInformationPush"; - Permission["BuiltInFeedAdminister"] = "BuiltInFeedAdminister"; - Permission["BuiltInFeedDownload"] = "BuiltInFeedDownload"; - Permission["BuiltInFeedPush"] = "BuiltInFeedPush"; - Permission["CertificateCreate"] = "CertificateCreate"; - Permission["CertificateDelete"] = "CertificateDelete"; - Permission["CertificateEdit"] = "CertificateEdit"; - Permission["CertificateView"] = "CertificateView"; - Permission["CertificateExportPrivateKey"] = "CertificateExportPrivateKey"; - Permission["ConfigureServer"] = "ConfigureServer"; - Permission["DefectReport"] = "DefectReport"; - Permission["DefectResolve"] = "DefectResolve"; - Permission["DeploymentCreate"] = "DeploymentCreate"; - Permission["DeploymentDelete"] = "DeploymentDelete"; - Permission["DeploymentView"] = "DeploymentView"; - Permission["EnvironmentCreate"] = "EnvironmentCreate"; - Permission["EnvironmentDelete"] = "EnvironmentDelete"; - Permission["EnvironmentEdit"] = "EnvironmentEdit"; - Permission["EnvironmentView"] = "EnvironmentView"; - Permission["EventView"] = "EventView"; - Permission["FeedEdit"] = "FeedEdit"; - Permission["FeedView"] = "FeedView"; - Permission["InterruptionSubmit"] = "InterruptionSubmit"; - Permission["InterruptionView"] = "InterruptionView"; - Permission["InterruptionViewSubmitResponsible"] = "InterruptionViewSubmitResponsible"; - Permission["LibraryVariableSetCreate"] = "LibraryVariableSetCreate"; - Permission["LibraryVariableSetDelete"] = "LibraryVariableSetDelete"; - Permission["LibraryVariableSetEdit"] = "LibraryVariableSetEdit"; - Permission["LibraryVariableSetView"] = "LibraryVariableSetView"; - Permission["LifecycleCreate"] = "LifecycleCreate"; - Permission["LifecycleDelete"] = "LifecycleDelete"; - Permission["LifecycleEdit"] = "LifecycleEdit"; - Permission["LifecycleView"] = "LifecycleView"; - Permission["ReleaseCreate"] = "ReleaseCreate"; - Permission["ReleaseView"] = "ReleaseView"; - Permission["ReleaseEdit"] = "ReleaseEdit"; - Permission["ReleaseDelete"] = "ReleaseDelete"; - Permission["MachineCreate"] = "MachineCreate"; - Permission["MachineEdit"] = "MachineEdit"; - Permission["MachineView"] = "MachineView"; - Permission["MachineDelete"] = "MachineDelete"; - Permission["MachinePolicyCreate"] = "MachinePolicyCreate"; - Permission["MachinePolicyDelete"] = "MachinePolicyDelete"; - Permission["MachinePolicyEdit"] = "MachinePolicyEdit"; - Permission["MachinePolicyView"] = "MachinePolicyView"; - Permission["ProjectGroupCreate"] = "ProjectGroupCreate"; - Permission["ProjectGroupDelete"] = "ProjectGroupDelete"; - Permission["ProjectGroupEdit"] = "ProjectGroupEdit"; - Permission["ProjectGroupView"] = "ProjectGroupView"; - Permission["TenantCreate"] = "TenantCreate"; - Permission["TenantDelete"] = "TenantDelete"; - Permission["TenantEdit"] = "TenantEdit"; - Permission["TenantView"] = "TenantView"; - Permission["TagSetCreate"] = "TagSetCreate"; - Permission["TagSetDelete"] = "TagSetDelete"; - Permission["TagSetEdit"] = "TagSetEdit"; - Permission["ProcessEdit"] = "ProcessEdit"; - Permission["ProcessView"] = "ProcessView"; - Permission["ProjectCreate"] = "ProjectCreate"; - Permission["ProjectDelete"] = "ProjectDelete"; - Permission["ProjectEdit"] = "ProjectEdit"; - Permission["ProjectView"] = "ProjectView"; - Permission["ProxyCreate"] = "ProxyCreate"; - Permission["ProxyDelete"] = "ProxyDelete"; - Permission["ProxyEdit"] = "ProxyEdit"; - Permission["ProxyView"] = "ProxyView"; - Permission["RunbookEdit"] = "RunbookEdit"; - Permission["RunbookView"] = "RunbookView"; - Permission["RunbookRunCreate"] = "RunbookRunCreate"; - Permission["RunbookRunEdit"] = "RunbookRunEdit"; - Permission["RunbookRunView"] = "RunbookRunView"; - Permission["SpaceCreate"] = "SpaceCreate"; - Permission["SpaceDelete"] = "SpaceDelete"; - Permission["SpaceEdit"] = "SpaceEdit"; - Permission["SpaceView"] = "SpaceView"; - Permission["SubscriptionCreate"] = "SubscriptionCreate"; - Permission["SubscriptionDelete"] = "SubscriptionDelete"; - Permission["SubscriptionEdit"] = "SubscriptionEdit"; - Permission["SubscriptionView"] = "SubscriptionView"; - Permission["TaskCancel"] = "TaskCancel"; - Permission["TaskCreate"] = "TaskCreate"; - Permission["TaskEdit"] = "TaskEdit"; - Permission["TaskView"] = "TaskView"; - Permission["TeamCreate"] = "TeamCreate"; - Permission["TeamDelete"] = "TeamDelete"; - Permission["TeamEdit"] = "TeamEdit"; - Permission["TeamView"] = "TeamView"; - Permission["TriggerCreate"] = "TriggerCreate"; - Permission["TriggerDelete"] = "TriggerDelete"; - Permission["TriggerEdit"] = "TriggerEdit"; - Permission["TriggerView"] = "TriggerView"; - Permission["UserEdit"] = "UserEdit"; - Permission["UserInvite"] = "UserInvite"; - Permission["UserView"] = "UserView"; - Permission["UserRoleEdit"] = "UserRoleEdit"; - Permission["UserRoleView"] = "UserRoleView"; - Permission["VariableEdit"] = "VariableEdit"; - Permission["VariableEditUnscoped"] = "VariableEditUnscoped"; - Permission["VariableView"] = "VariableView"; - Permission["VariableViewUnscoped"] = "VariableViewUnscoped"; - Permission["WorkerEdit"] = "WorkerEdit"; - Permission["WorkerView"] = "WorkerView"; -})(Permission = exports.Permission || (exports.Permission = {})); -//# sourceMappingURL=permission.js.map +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); -/***/ }), +// eslint-disable-next-line func-names +AxiosError.from = function(error, code, config, request, response, customProps) { + var axiosError = Object.create(prototype); -/***/ 54710: -/***/ ((__unused_webpack_module, exports) => { + utils.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }); -"use strict"; + AxiosError.call(axiosError, error.message, code, config, request, response); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=permissionDescriptions.js.map + axiosError.name = error.name; -/***/ }), + customProps && Object.assign(axiosError, customProps); -/***/ 81148: -/***/ ((__unused_webpack_module, exports) => { + return axiosError; +}; -"use strict"; +module.exports = AxiosError; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=phaseResource.js.map /***/ }), -/***/ 32771: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3214: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var _a; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProcessTypeAliasMap = exports.ProcessType = void 0; -var ProcessType; -(function (ProcessType) { - ProcessType["Deployment"] = "Deployment"; - ProcessType["Runbook"] = "Runbook"; -})(ProcessType = exports.ProcessType || (exports.ProcessType = {})); -exports.ProcessTypeAliasMap = (_a = {}, - _a[ProcessType.Deployment] = { - alias: { - noun: "deployment", - verb: "deploy", - plural: "deployments", - pastTense: "deployed", - preposition: "to", - }, - manifest: "Release", - }, - _a[ProcessType.Runbook] = { - alias: { - noun: "runbook", - verb: "run", - plural: "runs", - pastTense: "ran", - preposition: "on", - }, - manifest: "Snapshot", - }, - _a); -//# sourceMappingURL=processType.js.map - -/***/ }), -/***/ 29703: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(20328); -"use strict"; +function InterceptorManager() { + this.handlers = []; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=progressionResource.js.map +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; -/***/ }), +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; -/***/ 47875: -/***/ ((__unused_webpack_module, exports) => { +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; -"use strict"; +module.exports = InterceptorManager; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectExportRequest.js.map /***/ }), -/***/ 62054: -/***/ ((__unused_webpack_module, exports) => { +/***/ 41934: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectExportResponse.js.map - -/***/ }), -/***/ 29029: -/***/ ((__unused_webpack_module, exports) => { +var isAbsoluteURL = __nccwpck_require__(41301); +var combineURLs = __nccwpck_require__(57189); -"use strict"; +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectGroupResource.js.map /***/ }), -/***/ 95699: -/***/ ((__unused_webpack_module, exports) => { +/***/ 85062: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportFile.js.map - -/***/ }), -/***/ 55795: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(20328); +var transformData = __nccwpck_require__(19812); +var isCancel = __nccwpck_require__(64057); +var defaults = __nccwpck_require__(21626); +var CanceledError = __nccwpck_require__(34098); -"use strict"; +/** + * Throws a `CanceledError` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportFileListResponse.js.map + if (config.signal && config.signal.aborted) { + throw new CanceledError(); + } +} -/***/ }), +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); -/***/ 24196: -/***/ ((__unused_webpack_module, exports) => { + // Ensure headers exist + config.headers = config.headers || {}; -"use strict"; + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportPreviewRequest.js.map + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); -/***/ }), + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); -/***/ 86630: -/***/ ((__unused_webpack_module, exports) => { + var adapter = config.adapter || defaults.adapter; -"use strict"; + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportPreviewResponse.js.map + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); -/***/ }), + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); -/***/ 70634: -/***/ ((__unused_webpack_module, exports) => { + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } -"use strict"; + return Promise.reject(reason); + }); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportRequest.js.map /***/ }), -/***/ 89763: -/***/ ((__unused_webpack_module, exports) => { +/***/ 74831: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectImportResponse.js.map - -/***/ }), -/***/ 97446: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(20328); -"use strict"; +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getBranchNameFromRouteParameter = exports.getURISafeBranchName = exports.isVcsBranchResource = exports.NewProject = exports.HasVersionControlledPersistenceSettings = exports.HasVcsProjectResourceLinks = exports.IsUsingUsernamePasswordAuth = exports.AuthenticationType = exports.PersistenceSettingsType = void 0; -var PersistenceSettingsType; -(function (PersistenceSettingsType) { - PersistenceSettingsType["VersionControlled"] = "VersionControlled"; - PersistenceSettingsType["Database"] = "Database"; -})(PersistenceSettingsType = exports.PersistenceSettingsType || (exports.PersistenceSettingsType = {})); -var AuthenticationType; -(function (AuthenticationType) { - AuthenticationType["Anonymous"] = "Anonymous"; - AuthenticationType["UsernamePassword"] = "UsernamePassword"; -})(AuthenticationType = exports.AuthenticationType || (exports.AuthenticationType = {})); -function IsUsingUsernamePasswordAuth(T) { - return (T.Type === - AuthenticationType.UsernamePassword); -} -exports.IsUsingUsernamePasswordAuth = IsUsingUsernamePasswordAuth; -function HasVcsProjectResourceLinks(links) { - return links.Branches !== undefined; -} -exports.HasVcsProjectResourceLinks = HasVcsProjectResourceLinks; -function HasVersionControlledPersistenceSettings(T) { - return T.Type === PersistenceSettingsType.VersionControlled; -} -exports.HasVersionControlledPersistenceSettings = HasVersionControlledPersistenceSettings; -function NewProject(name, projectGroup, lifecycle) { - return { - LifecycleId: lifecycle.Id, - Name: name, - ProjectGroupId: projectGroup.Id, - }; -} -exports.NewProject = NewProject; -function isVcsBranchResource(branch) { - return branch.Name !== undefined; -} -exports.isVcsBranchResource = isVcsBranchResource; -function getURISafeBranchName(branch) { - return encodeURIComponent(branch.Name); -} -exports.getURISafeBranchName = getURISafeBranchName; -function getBranchNameFromRouteParameter(routeParameter) { - if (routeParameter) { - return decodeURIComponent(routeParameter); + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); } - return undefined; -} -exports.getBranchNameFromRouteParameter = getBranchNameFromRouteParameter; -//# sourceMappingURL=projectResource.js.map + return source; + } -/***/ }), + // eslint-disable-next-line consistent-return + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(undefined, config1[prop]); + } + } -/***/ 91535: -/***/ ((__unused_webpack_module, exports) => { + // eslint-disable-next-line consistent-return + function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(undefined, config2[prop]); + } + } -"use strict"; + // eslint-disable-next-line consistent-return + function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(undefined, config1[prop]); + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectSummary.js.map + // eslint-disable-next-line consistent-return + function mergeDirectKeys(prop) { + if (prop in config2) { + return getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + return getMergedValue(undefined, config1[prop]); + } + } -/***/ }), + var mergeMap = { + 'url': valueFromConfig2, + 'method': valueFromConfig2, + 'data': valueFromConfig2, + 'baseURL': defaultToConfig2, + 'transformRequest': defaultToConfig2, + 'transformResponse': defaultToConfig2, + 'paramsSerializer': defaultToConfig2, + 'timeout': defaultToConfig2, + 'timeoutMessage': defaultToConfig2, + 'withCredentials': defaultToConfig2, + 'adapter': defaultToConfig2, + 'responseType': defaultToConfig2, + 'xsrfCookieName': defaultToConfig2, + 'xsrfHeaderName': defaultToConfig2, + 'onUploadProgress': defaultToConfig2, + 'onDownloadProgress': defaultToConfig2, + 'decompress': defaultToConfig2, + 'maxContentLength': defaultToConfig2, + 'maxBodyLength': defaultToConfig2, + 'beforeRedirect': defaultToConfig2, + 'transport': defaultToConfig2, + 'httpAgent': defaultToConfig2, + 'httpsAgent': defaultToConfig2, + 'cancelToken': defaultToConfig2, + 'socketPath': defaultToConfig2, + 'responseEncoding': defaultToConfig2, + 'validateStatus': mergeDirectKeys + }; -/***/ 40903: -/***/ ((__unused_webpack_module, exports) => { + utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + var merge = mergeMap[prop] || mergeDeepProperties; + var configValue = merge(prop); + (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); -"use strict"; + return config; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectUsage.js.map /***/ }), -/***/ 70913: -/***/ ((__unused_webpack_module, exports) => { +/***/ 13211: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=projectedTeamReferenceDataItem.js.map - -/***/ }), -/***/ 28620: -/***/ ((__unused_webpack_module, exports) => { +var AxiosError = __nccwpck_require__(72093); -"use strict"; +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSensitiveValue = exports.NewSensitiveValue = void 0; -function NewSensitiveValue(value, hint) { - return { - HasValue: true, - Hint: hint, - NewValue: value, - }; -} -exports.NewSensitiveValue = NewSensitiveValue; -function isSensitiveValue(value) { - if (typeof value === "string" || value === null) { - return false; - } - return Object.prototype.hasOwnProperty.call(value, "HasValue"); -} -exports.isSensitiveValue = isSensitiveValue; -//# sourceMappingURL=propertyValueResource.js.map /***/ }), -/***/ 13627: -/***/ ((__unused_webpack_module, exports) => { +/***/ 19812: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=proxyResource.js.map -/***/ }), +var utils = __nccwpck_require__(20328); +var defaults = __nccwpck_require__(21626); -/***/ 35168: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); -"use strict"; + return data; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isProcessReferenceDataItem = void 0; -var utils_1 = __nccwpck_require__(12765); -function isProcessReferenceDataItem(item) { - if (!item) { - return false; - } - var converted = item; - return (0, utils_1.isPropertyDefinedAndNotNull)(converted, "ProcessType"); -} -exports.isProcessReferenceDataItem = isProcessReferenceDataItem; -//# sourceMappingURL=referenceDataItem.js.map /***/ }), -/***/ 43924: -/***/ ((__unused_webpack_module, exports) => { +/***/ 17024: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +// eslint-disable-next-line strict +module.exports = __nccwpck_require__(64334); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseChanges.js.map /***/ }), -/***/ 65898: -/***/ ((__unused_webpack_module, exports) => { +/***/ 21626: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releasePackageVersionBuildInformation.js.map - -/***/ }), -/***/ 91699: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(20328); +var normalizeHeaderName = __nccwpck_require__(36240); +var AxiosError = __nccwpck_require__(72093); +var transitionalDefaults = __nccwpck_require__(40936); +var toFormData = __nccwpck_require__(20470); -"use strict"; +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releasePackageVersionBuildInformationResource.js.map +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} -/***/ }), +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __nccwpck_require__(3454); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __nccwpck_require__(68104); + } + return adapter; +} -/***/ 33437: -/***/ ((__unused_webpack_module, exports) => { +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } -"use strict"; + return (encoder || JSON.stringify)(rawValue); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseProgressionResource.js.map +var defaults = { -/***/ }), + transitional: transitionalDefaults, -/***/ 97610: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + adapter: getDefaultAdapter(), -"use strict"; + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isRunbookSnapshotResource = exports.isReleaseResource = void 0; -var utils_1 = __nccwpck_require__(12765); -function isReleaseResource(resource) { - if (resource === undefined || resource === null) { - return false; + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; } - var converted = resource; - return (converted.Version !== undefined && - (0, utils_1.typeSafeHasOwnProperty)(converted, "Version")); -} -exports.isReleaseResource = isReleaseResource; -function isRunbookSnapshotResource(resource) { - if (resource === undefined || resource === null) { - return false; + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); } - var converted = resource; - return (converted.Name !== undefined && (0, utils_1.typeSafeHasOwnProperty)(converted, "Name")); -} -exports.isRunbookSnapshotResource = isRunbookSnapshotResource; -//# sourceMappingURL=releaseResource.js.map - -/***/ }), - -/***/ 80014: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseTemplateResource.js.map + var isObjectPayload = utils.isObject(data); + var contentType = headers && headers['Content-Type']; -/***/ }), + var isFileList; -/***/ 25462: -/***/ ((__unused_webpack_module, exports) => { + if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) { + var _FormData = this.env && this.env.FormData; + return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData()); + } else if (isObjectPayload || contentType === 'application/json') { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } -"use strict"; + return data; + }], -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseUsage.js.map + transformResponse: [function transformResponse(data) { + var transitional = this.transitional || defaults.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; -/***/ }), + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } -/***/ 93411: -/***/ ((__unused_webpack_module, exports) => { + return data; + }], -"use strict"; + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=releaseUsageEntry.js.map + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', -/***/ }), + maxContentLength: -1, + maxBodyLength: -1, -/***/ 22245: -/***/ ((__unused_webpack_module, exports) => { + env: { + FormData: __nccwpck_require__(17024) + }, -"use strict"; + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=resource.js.map + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; -/***/ }), +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); -/***/ 40496: -/***/ ((__unused_webpack_module, exports) => { +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); -"use strict"; +module.exports = defaults; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=resourceCollection.js.map /***/ }), -/***/ 42338: -/***/ ((__unused_webpack_module, exports) => { +/***/ 40936: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=resourceCollectionLinks.js.map -/***/ }), +module.exports = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; -/***/ 95297: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/***/ }), -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=retentionDefaultConfigurationResource.js.map +/***/ 94322: +/***/ ((module) => { + +module.exports = { + "version": "0.27.2" +}; /***/ }), -/***/ 96286: -/***/ ((__unused_webpack_module, exports) => { +/***/ 77065: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RetentionUnit = void 0; -var RetentionUnit; -(function (RetentionUnit) { - RetentionUnit["Days"] = "Days"; - RetentionUnit["Items"] = "Items"; -})(RetentionUnit = exports.RetentionUnit || (exports.RetentionUnit = {})); -//# sourceMappingURL=retentionPeriod.js.map + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + /***/ }), -/***/ 63216: -/***/ ((__unused_webpack_module, exports) => { +/***/ 30646: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=rootResource.js.map -/***/ }), +var utils = __nccwpck_require__(20328); -/***/ 98411: -/***/ ((__unused_webpack_module, exports) => { +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} -"use strict"; +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookProcessResource.js.map + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; -/***/ }), + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } -/***/ 36029: -/***/ ((__unused_webpack_module, exports) => { + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } -"use strict"; + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookProgressionResource.js.map + serializedParams = parts.join('&'); + } -/***/ }), + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } -/***/ 5899: -/***/ ((__unused_webpack_module, exports) => { + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } -"use strict"; + return url; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IsNonVcsRunbook = void 0; -function IsNonVcsRunbook(runbook) { - return runbook.ProjectId !== undefined; -} -exports.IsNonVcsRunbook = IsNonVcsRunbook; -//# sourceMappingURL=runbookResource.js.map /***/ }), -/***/ 11400: -/***/ ((__unused_webpack_module, exports) => { +/***/ 57189: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookResourceLinks.js.map + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + /***/ }), -/***/ 26571: -/***/ ((__unused_webpack_module, exports) => { +/***/ 21545: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunbookRunParameters = void 0; -var RunbookRunParameters = (function () { - function RunbookRunParameters() { - this.EnvironmentIds = []; - this.ExcludedMachineIds = []; - this.ForcePackageDownload = false; - this.SkipActions = []; - this.SpecificMachineIds = []; - this.UseDefaultSnapshot = true; - } - RunbookRunParameters.MapFrom = function (runbookRun) { - var _a, _b, _c; - return { - EnvironmentId: runbookRun.EnvironmentId, - ExcludedMachineIds: runbookRun.ExcludedMachineIds != null ? runbookRun.ExcludedMachineIds : [], - ForcePackageDownload: runbookRun.ForcePackageDownload, - FormValues: (_a = runbookRun.FormValues) !== null && _a !== void 0 ? _a : {}, - ProjectId: runbookRun.ProjectId, - QueueTime: (_b = runbookRun.QueueTime) === null || _b === void 0 ? void 0 : _b.toString(), - QueueTimeExpiry: (_c = runbookRun.QueueTimeExpiry) === null || _c === void 0 ? void 0 : _c.toString(), - RunbookId: runbookRun.RunbookId, - SkipActions: runbookRun.SkipActions != null ? runbookRun.SkipActions : [], - SpecificMachineIds: runbookRun.SpecificMachineIds != null ? runbookRun.SpecificMachineIds : [], - TenantId: runbookRun.TenantId, - UseDefaultSnapshot: true, - UseGuidedFailure: runbookRun.UseGuidedFailure, - }; - }; - return RunbookRunParameters; -}()); -exports.RunbookRunParameters = RunbookRunParameters; -//# sourceMappingURL=runbookRunParameters.js.map -/***/ }), +var utils = __nccwpck_require__(20328); -/***/ 19891: -/***/ ((__unused_webpack_module, exports) => { +module.exports = ( + utils.isStandardBrowserEnv() ? -"use strict"; + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookRunResource.js.map + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } -/***/ }), + if (utils.isString(path)) { + cookie.push('path=' + path); + } -/***/ 82034: -/***/ ((__unused_webpack_module, exports) => { + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } -"use strict"; + if (secure === true) { + cookie.push('secure'); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookRunTemplateResource.js.map + document.cookie = cookie.join('; '); + }, -/***/ }), + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, -/***/ 47106: -/***/ ((__unused_webpack_module, exports) => { + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : -"use strict"; + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookSnapshotResource.js.map /***/ }), -/***/ 34703: -/***/ ((__unused_webpack_module, exports) => { +/***/ 41301: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbookSnapshotTemplateResource.js.map + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +}; + /***/ }), -/***/ 77703: -/***/ ((__unused_webpack_module, exports) => { +/***/ 60650: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=runbooksDashboardItemResource.js.map - -/***/ }), -/***/ 24223: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var utils = __nccwpck_require__(20328); -"use strict"; +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return utils.isObject(payload) && (payload.isAxiosError === true); +}; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RunRunbookActionResource = exports.ScheduleIntervalResource = exports.DeployNewReleaseActionResource = exports.DeployLatestReleaseActionResource = exports.ScopedDeploymentActionResource = exports.CronTriggerScheduleResource = exports.DaysPerMonthTriggerScheduleResource = exports.ContinuousDailyTriggerScheduleResource = exports.OnceDailyTriggerScheduleResource = exports.TriggerScheduleIntervalResource = exports.TriggerScheduleResource = void 0; -var triggerActionResource_1 = __nccwpck_require__(59636); -var triggerActionType_1 = __nccwpck_require__(58574); -var triggerFilterResource_1 = __nccwpck_require__(1033); -var triggerFilterType_1 = __nccwpck_require__(30292); -var triggerScheduleIntervalType_1 = __nccwpck_require__(81599); -var TriggerScheduleResource = (function (_super) { - __extends(TriggerScheduleResource, _super); - function TriggerScheduleResource() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.Timezone = undefined; - return _this; - } - return TriggerScheduleResource; -}(triggerFilterResource_1.TriggerFilterResource)); -exports.TriggerScheduleResource = TriggerScheduleResource; -var TriggerScheduleIntervalResource = (function () { - function TriggerScheduleIntervalResource() { - this.Interval = triggerScheduleIntervalType_1.TriggerScheduleIntervalType.OnceDaily; - } - return TriggerScheduleIntervalResource; -}()); -exports.TriggerScheduleIntervalResource = TriggerScheduleIntervalResource; -var OnceDailyTriggerScheduleResource = (function (_super) { - __extends(OnceDailyTriggerScheduleResource, _super); - function OnceDailyTriggerScheduleResource() { - var _this = _super.call(this) || this; - _this.StartTime = undefined; - _this.DaysOfWeek = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.OnceDailySchedule; - return _this; - } - return OnceDailyTriggerScheduleResource; -}(TriggerScheduleResource)); -exports.OnceDailyTriggerScheduleResource = OnceDailyTriggerScheduleResource; -var ContinuousDailyTriggerScheduleResource = (function (_super) { - __extends(ContinuousDailyTriggerScheduleResource, _super); - function ContinuousDailyTriggerScheduleResource() { - var _this = _super.call(this) || this; - _this.RunAfter = undefined; - _this.RunUntil = undefined; - _this.Interval = triggerScheduleIntervalType_1.TriggerScheduleIntervalType.OnceHourly; - _this.DaysOfWeek = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.ContinuousDailySchedule; - return _this; - } - return ContinuousDailyTriggerScheduleResource; -}(TriggerScheduleResource)); -exports.ContinuousDailyTriggerScheduleResource = ContinuousDailyTriggerScheduleResource; -var DaysPerMonthTriggerScheduleResource = (function (_super) { - __extends(DaysPerMonthTriggerScheduleResource, _super); - function DaysPerMonthTriggerScheduleResource() { - var _this = _super.call(this) || this; - _this.StartTime = undefined; - _this.MonthlyScheduleType = undefined; - _this.DayOfWeek = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.DaysPerMonthSchedule; - return _this; - } - return DaysPerMonthTriggerScheduleResource; -}(TriggerScheduleResource)); -exports.DaysPerMonthTriggerScheduleResource = DaysPerMonthTriggerScheduleResource; -var CronTriggerScheduleResource = (function (_super) { - __extends(CronTriggerScheduleResource, _super); - function CronTriggerScheduleResource() { - var _this = _super.call(this) || this; - _this.CronExpression = undefined; - _this.FilterType = triggerFilterType_1.TriggerFilterType.CronExpressionSchedule; - return _this; - } - return CronTriggerScheduleResource; -}(TriggerScheduleResource)); -exports.CronTriggerScheduleResource = CronTriggerScheduleResource; -var ScopedDeploymentActionResource = (function (_super) { - __extends(ScopedDeploymentActionResource, _super); - function ScopedDeploymentActionResource() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.ChannelId = undefined; - _this.TenantIds = []; - _this.TenantTags = []; - _this.Variables = undefined; - return _this; - } - return ScopedDeploymentActionResource; -}(triggerActionResource_1.TriggerActionResource)); -exports.ScopedDeploymentActionResource = ScopedDeploymentActionResource; -var DeployLatestReleaseActionResource = (function (_super) { - __extends(DeployLatestReleaseActionResource, _super); - function DeployLatestReleaseActionResource() { - var _this = _super.call(this) || this; - _this.DestinationEnvironmentId = undefined; - _this.ActionType = triggerActionType_1.TriggerActionType.DeployLatestRelease; - _this.ShouldRedeployWhenReleaseIsCurrent = true; - _this.SourceEnvironmentIds = []; - return _this; - } - return DeployLatestReleaseActionResource; -}(ScopedDeploymentActionResource)); -exports.DeployLatestReleaseActionResource = DeployLatestReleaseActionResource; -var DeployNewReleaseActionResource = (function (_super) { - __extends(DeployNewReleaseActionResource, _super); - function DeployNewReleaseActionResource() { - var _this = _super.call(this) || this; - _this.EnvironmentId = undefined; - _this.VersionControlReference = undefined; - _this.ActionType = triggerActionType_1.TriggerActionType.DeployNewRelease; - return _this; - } - return DeployNewReleaseActionResource; -}(ScopedDeploymentActionResource)); -exports.DeployNewReleaseActionResource = DeployNewReleaseActionResource; -var ScheduleIntervalResource = (function () { - function ScheduleIntervalResource() { - this.IntervalType = undefined; - this.IntervalValue = undefined; - } - return ScheduleIntervalResource; -}()); -exports.ScheduleIntervalResource = ScheduleIntervalResource; -var RunRunbookActionResource = (function (_super) { - __extends(RunRunbookActionResource, _super); - function RunRunbookActionResource() { - var _this = _super.call(this) || this; - _this.EnvironmentIds = undefined; - _this.RunbookId = undefined; - _this.TenantIds = []; - _this.TenantTags = []; - _this.ActionType = triggerActionType_1.TriggerActionType.RunRunbook; - return _this; - } - return RunRunbookActionResource; -}(triggerActionResource_1.TriggerActionResource)); -exports.RunRunbookActionResource = RunRunbookActionResource; -//# sourceMappingURL=scheduledProjectTriggerResource.js.map /***/ }), -/***/ 71606: -/***/ ((__unused_webpack_module, exports) => { +/***/ 33608: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scheduledTaskDetailsResource.js.map - -/***/ }), -/***/ 19038: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(20328); -"use strict"; +module.exports = ( + utils.isStandardBrowserEnv() ? -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scopeSpecificationTypes.js.map + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; -/***/ }), + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; -/***/ 39849: -/***/ ((__unused_webpack_module, exports) => { + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } -"use strict"; + urlParsingNode.setAttribute('href', href); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scopeValues.js.map + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } -/***/ }), + originURL = resolveURL(window.location.href); -/***/ 63390: -/***/ ((__unused_webpack_module, exports) => { + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : -"use strict"; + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=scopedUserRoleResource.js.map /***/ }), -/***/ 24752: -/***/ ((__unused_webpack_module, exports) => { +/***/ 36240: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ScriptingLanguage = void 0; -var ScriptingLanguage; -(function (ScriptingLanguage) { - ScriptingLanguage["Bash"] = "Bash"; - ScriptingLanguage["CSharp"] = "CSharp"; - ScriptingLanguage["FSharp"] = "FSharp"; - ScriptingLanguage["PowerShell"] = "PowerShell"; - ScriptingLanguage["Python"] = "Python"; -})(ScriptingLanguage = exports.ScriptingLanguage || (exports.ScriptingLanguage = {})); -//# sourceMappingURL=scriptingLanguage.js.map - -/***/ }), -/***/ 54000: -/***/ ((__unused_webpack_module, exports) => { +var utils = __nccwpck_require__(20328); -"use strict"; +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverConfigurationResource.js.map /***/ }), -/***/ 93704: -/***/ ((__unused_webpack_module, exports) => { +/***/ 86455: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverConfigurationSettingsSetResource.js.map -/***/ }), +var utils = __nccwpck_require__(20328); -/***/ 49281: -/***/ ((__unused_webpack_module, exports) => { +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; -"use strict"; +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverDocumentCount.js.map + if (!headers) { return parsed; } -/***/ }), + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); -/***/ 20114: -/***/ ((__unused_webpack_module, exports) => { + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); -"use strict"; + return parsed; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverStatusHealthResource.js.map /***/ }), -/***/ 93060: -/***/ ((__unused_webpack_module, exports) => { +/***/ 66107: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverStatusResource.js.map - -/***/ }), - -/***/ 32196: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +module.exports = function parseProtocol(url) { + var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=serverTimezoneResource.js.map /***/ }), -/***/ 82342: -/***/ ((__unused_webpack_module, exports) => { +/***/ 74850: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=settingsMetadataResource.js.map - -/***/ }), - -/***/ 66197: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=settingsValuesResource.js.map /***/ }), -/***/ 95317: -/***/ ((__unused_webpack_module, exports) => { +/***/ 20470: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=smtpConfigurationResource.js.map - -/***/ }), - -/***/ 64507: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +var utils = __nccwpck_require__(20328); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=smtpIsConfiguredResource.js.map +/** + * Convert a data object to FormData + * @param {Object} obj + * @param {?Object} [formData] + * @returns {Object} + **/ -/***/ }), +function toFormData(obj, formData) { + // eslint-disable-next-line no-param-reassign + formData = formData || new FormData(); -/***/ 26498: -/***/ ((__unused_webpack_module, exports) => { + var stack = []; -"use strict"; + function convertValue(value) { + if (value === null) return ''; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewSpace = void 0; -function NewSpace(name, spaceManagersTeams, spaceManagersTeamMembers) { - return { - Name: name, - SpaceManagersTeams: spaceManagersTeams === null || spaceManagersTeams === void 0 ? void 0 : spaceManagersTeams.map(function (t) { return t.Id; }), - SpaceManagersTeamMembers: spaceManagersTeamMembers === null || spaceManagersTeamMembers === void 0 ? void 0 : spaceManagersTeamMembers.map(function (u) { return u.Id; }), - }; -} -exports.NewSpace = NewSpace; -//# sourceMappingURL=spaceResource.js.map + if (utils.isDate(value)) { + return value.toISOString(); + } -/***/ }), + if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { + return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } -/***/ 10171: -/***/ ((__unused_webpack_module, exports) => { + return value; + } -"use strict"; + function build(data, parentKey) { + if (utils.isPlainObject(data) || utils.isArray(data)) { + if (stack.indexOf(data) !== -1) { + throw Error('Circular reference detected in ' + parentKey); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=spaceRootResource.js.map + stack.push(data); -/***/ }), + utils.forEach(data, function each(value, key) { + if (utils.isUndefined(value)) return; + var fullKey = parentKey ? parentKey + '.' + key : key; + var arr; -/***/ 37396: -/***/ ((__unused_webpack_module, exports) => { + if (value && !parentKey && typeof value === 'object') { + if (utils.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) { + // eslint-disable-next-line func-names + arr.forEach(function(el) { + !utils.isUndefined(el) && formData.append(fullKey, convertValue(el)); + }); + return; + } + } -"use strict"; + build(value, fullKey); + }); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=spaceScopedResource.js.map + stack.pop(); + } else { + formData.append(parentKey, convertValue(data)); + } + } -/***/ }), + build(obj); -/***/ 22152: -/***/ ((__unused_webpack_module, exports) => { + return formData; +} -"use strict"; +module.exports = toFormData; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=spaceSearchResult.js.map /***/ }), -/***/ 33543: -/***/ ((__unused_webpack_module, exports) => { +/***/ 51632: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=sshEndpointResource.js.map -/***/ }), +var VERSION = (__nccwpck_require__(94322).version); +var AxiosError = __nccwpck_require__(72093); -/***/ 94565: -/***/ ((__unused_webpack_module, exports) => { +var validators = {}; -"use strict"; +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=sshKeyPairAccountResource.js.map +var deprecatedWarnings = {}; -/***/ }), +/** + * Transitional option validator + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } -/***/ 32841: -/***/ ((__unused_webpack_module, exports) => { + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } -"use strict"; + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepPackage.js.map + return validator ? validator(value, opt, opts) : true; + }; +}; -/***/ }), +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ -/***/ 57461: -/***/ ((__unused_webpack_module, exports) => { +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} -"use strict"; +module.exports = { + assertOptions: assertOptions, + validators: validators +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepPackageDeploymentTargetType.js.map /***/ }), -/***/ 24458: -/***/ ((__unused_webpack_module, exports) => { +/***/ 20328: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isStepPackageEndpointResource = void 0; -function isStepPackageEndpointResource(resource) { - return "StepPackageId" in resource && "DeploymentTargetTypeId" in resource; -} -exports.isStepPackageEndpointResource = isStepPackageEndpointResource; -//# sourceMappingURL=stepPackageEndpointResource.js.map - -/***/ }), - -/***/ 75507: -/***/ ((__unused_webpack_module, exports) => { -"use strict"; +var bind = __nccwpck_require__(77065); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepPackageLinks.js.map +// utils is a library of generic helper functions non-specific to axios -/***/ }), +var toString = Object.prototype.toString; -/***/ 42857: -/***/ ((__unused_webpack_module, exports) => { +// eslint-disable-next-line func-names +var kindOf = (function(cache) { + // eslint-disable-next-line func-names + return function(thing) { + var str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); + }; +})(Object.create(null)); -"use strict"; +function kindOfTest(type) { + type = type.toLowerCase(); + return function isKindOf(thing) { + return kindOf(thing) === type; + }; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepUsage.js.map +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return Array.isArray(val); +} -/***/ }), +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} -/***/ 19863: -/***/ ((__unused_webpack_module, exports) => { +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} -"use strict"; +/** + * Determine if a value is an ArrayBuffer + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +var isArrayBuffer = kindOfTest('ArrayBuffer'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=stepUsageEntry.js.map -/***/ }), +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} -/***/ 50606: -/***/ ((__unused_webpack_module, exports) => { +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} -"use strict"; +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isExistingSubscriptionResource = exports.SubscriptionType = void 0; -var SubscriptionType; -(function (SubscriptionType) { - SubscriptionType["Event"] = "Event"; -})(SubscriptionType = exports.SubscriptionType || (exports.SubscriptionType = {})); -function isExistingSubscriptionResource(T) { - return T.Links !== undefined; +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; } -exports.isExistingSubscriptionResource = isExistingSubscriptionResource; -//# sourceMappingURL=subscriptionResource.js.map -/***/ }), +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (kindOf(val) !== 'object') { + return false; + } -/***/ 65252: -/***/ ((__unused_webpack_module, exports) => { + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} -"use strict"; +/** + * Determine if a value is a Date + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +var isDate = kindOfTest('Date'); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=summaryResource.js.map +/** + * Determine if a value is a File + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +var isFile = kindOfTest('File'); -/***/ }), +/** + * Determine if a value is a Blob + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +var isBlob = kindOfTest('Blob'); -/***/ 51140: -/***/ ((__unused_webpack_module, exports) => { +/** + * Determine if a value is a FileList + * + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +var isFileList = kindOfTest('FileList'); -"use strict"; +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=systemInfoResource.js.map +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} -/***/ }), +/** + * Determine if a value is a FormData + * + * @param {Object} thing The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(thing) { + var pattern = '[object FormData]'; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || + toString.call(thing) === pattern || + (isFunction(thing.toString) && thing.toString() === pattern) + ); +} -/***/ 38664: -/***/ ((__unused_webpack_module, exports) => { +/** + * Determine if a value is a URLSearchParams object + * @function + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +var isURLSearchParams = kindOfTest('URLSearchParams'); -"use strict"; +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tagResource.js.map +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} -/***/ }), +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } -/***/ 44990: -/***/ ((__unused_webpack_module, exports) => { + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } -"use strict"; + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tagSetResource.js.map +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } -/***/ }), + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} -/***/ 30874: -/***/ ((__unused_webpack_module, exports) => { +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} -"use strict"; +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ActivityLogEntryCategory = exports.ActivityStatus = void 0; -var ActivityStatus; -(function (ActivityStatus) { - ActivityStatus["Pending"] = "Pending"; - ActivityStatus["Running"] = "Running"; - ActivityStatus["Success"] = "Success"; - ActivityStatus["Failed"] = "Failed"; - ActivityStatus["Skipped"] = "Skipped"; - ActivityStatus["SuccessWithWarning"] = "SuccessWithWarning"; - ActivityStatus["Canceled"] = "Canceled"; -})(ActivityStatus = exports.ActivityStatus || (exports.ActivityStatus = {})); -var ActivityLogEntryCategory; -(function (ActivityLogEntryCategory) { - ActivityLogEntryCategory["Trace"] = "Trace"; - ActivityLogEntryCategory["Verbose"] = "Verbose"; - ActivityLogEntryCategory["Info"] = "Info"; - ActivityLogEntryCategory["Highlight"] = "Highlight"; - ActivityLogEntryCategory["Wait"] = "Wait"; - ActivityLogEntryCategory["Gap"] = "Gap"; - ActivityLogEntryCategory["Alert"] = "Alert"; - ActivityLogEntryCategory["Warning"] = "Warning"; - ActivityLogEntryCategory["Error"] = "Error"; - ActivityLogEntryCategory["Fatal"] = "Fatal"; - ActivityLogEntryCategory["Planned"] = "Planned"; - ActivityLogEntryCategory["Updated"] = "Updated"; - ActivityLogEntryCategory["Finished"] = "Finished"; - ActivityLogEntryCategory["Abandoned"] = "Abandoned"; -})(ActivityLogEntryCategory = exports.ActivityLogEntryCategory || (exports.ActivityLogEntryCategory = {})); -//# sourceMappingURL=taskDetailsResource.js.map +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + */ -/***/ }), +function inherits(constructor, superConstructor, props, descriptors) { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + props && Object.assign(constructor.prototype, props); +} -/***/ 87516: -/***/ ((__unused_webpack_module, exports) => { +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function} [filter] + * @returns {Object} + */ -"use strict"; +function toFlatObject(sourceObj, destObj, filter) { + var props; + var i; + var prop; + var merged = {}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TaskName = void 0; -var TaskName; -(function (TaskName) { - TaskName["Health"] = "Health"; - TaskName["AdHocScript"] = "AdHocScript"; - TaskName["ConfigureLetsEncrypt"] = "ConfigureLetsEncrypt"; - TaskName["Upgrade"] = "Upgrade"; - TaskName["TestEmail"] = "TestEmail"; - TaskName["TestAccount"] = "TestAccount"; - TaskName["SystemIntegrityCheck"] = "SystemIntegrityCheck"; - TaskName["SyncCommunityActionTemplates"] = "SyncCommunityActionTemplates"; - TaskName["SynchronizeBuiltInPackageRepositoryIndex"] = "SynchronizeBuiltInPackageRepositoryIndex"; - TaskName["UpdateCalamari"] = "UpdateCalamari"; -})(TaskName = exports.TaskName || (exports.TaskName = {})); -//# sourceMappingURL=taskName.js.map + destObj = destObj || {}; -/***/ }), + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if (!merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = Object.getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); -/***/ 84199: -/***/ ((__unused_webpack_module, exports) => { + return destObj; +} -"use strict"; +/* + * determines whether a string ends with the characters of a specified string + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * @returns {boolean} + */ +function endsWith(str, searchString, position) { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + var lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=taskResource.js.map -/***/ }), +/** + * Returns new array from array like object + * @param {*} [thing] + * @returns {Array} + */ +function toArray(thing) { + if (!thing) return null; + var i = thing.length; + if (isUndefined(i)) return null; + var arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} -/***/ 84955: -/***/ ((__unused_webpack_module, exports) => { +// eslint-disable-next-line func-names +var isTypedArray = (function(TypedArray) { + // eslint-disable-next-line func-names + return function(thing) { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array)); -"use strict"; +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM, + inherits: inherits, + toFlatObject: toFlatObject, + kindOf: kindOf, + kindOfTest: kindOfTest, + endsWith: endsWith, + toArray: toArray, + isTypedArray: isTypedArray, + isFileList: isFileList +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TaskRestrictedTo = void 0; -var TaskRestrictedTo; -(function (TaskRestrictedTo) { - TaskRestrictedTo["DeploymentTargets"] = "DeploymentTargets"; - TaskRestrictedTo["Workers"] = "Workers"; - TaskRestrictedTo["Policies"] = "Policies"; - TaskRestrictedTo["Unrestricted"] = "Unrestricted"; -})(TaskRestrictedTo = exports.TaskRestrictedTo || (exports.TaskRestrictedTo = {})); -//# sourceMappingURL=taskRestrictedTo.js.map /***/ }), -/***/ 36445: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9417: +/***/ ((module) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TaskState = void 0; -var TaskState; -(function (TaskState) { - TaskState["Canceled"] = "Canceled"; - TaskState["Cancelling"] = "Cancelling"; - TaskState["Executing"] = "Executing"; - TaskState["Failed"] = "Failed"; - TaskState["Queued"] = "Queued"; - TaskState["Success"] = "Success"; - TaskState["TimedOut"] = "TimedOut"; -})(TaskState = exports.TaskState || (exports.TaskState = {})); -//# sourceMappingURL=taskState.js.map - -/***/ }), +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); -/***/ 20736: -/***/ ((__unused_webpack_module, exports) => { + var r = range(a, b, str); -"use strict"; + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=teamMembership.js.map +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} -/***/ }), +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; -/***/ 54797: -/***/ ((__unused_webpack_module, exports) => { + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; -"use strict"; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=teamResource.js.map + bi = str.indexOf(b, i + 1); + } -/***/ }), + i = ai < bi && ai >= 0 ? ai : bi; + } -/***/ 31113: -/***/ ((__unused_webpack_module, exports) => { + if (begs.length) { + result = [ left, right ]; + } + } -"use strict"; + return result; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tenantMissingVariablesResource.js.map /***/ }), -/***/ 67683: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tenantResource.js.map +/***/ 83682: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -/***/ }), +var register = __nccwpck_require__(44670) +var addHook = __nccwpck_require__(5549) +var removeHook = __nccwpck_require__(6819) -/***/ 77693: -/***/ ((__unused_webpack_module, exports) => { +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind +var bindable = bind.bind(bind) -"use strict"; +function bindApi (hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) + hook.api = { remove: removeHookRef } + hook.remove = removeHookRef -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tenantVariableResource.js.map + ;['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 +} -/***/ 68517: -/***/ ((__unused_webpack_module, exports) => { +function HookCollection () { + var state = { + registry: {} + } -"use strict"; + var hook = register.bind(null, state) + bindApi(hook, state) -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TenantedDeploymentMode = void 0; -var TenantedDeploymentMode; -(function (TenantedDeploymentMode) { - TenantedDeploymentMode["Untenanted"] = "Untenanted"; - TenantedDeploymentMode["TenantedOrUntenanted"] = "TenantedOrUntenanted"; - TenantedDeploymentMode["Tenanted"] = "Tenanted"; -})(TenantedDeploymentMode = exports.TenantedDeploymentMode || (exports.TenantedDeploymentMode = {})); -//# sourceMappingURL=tenantedDeploymentMode.js.map + return hook +} -/***/ }), +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() +} -/***/ 70229: -/***/ (function(__unused_webpack_module, exports) { +Hook.Singular = HookSingular.bind() +Hook.Collection = HookCollection.bind() -"use strict"; +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 -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TimeSpanString = void 0; -var TimeSpanString = (function (_super) { - __extends(TimeSpanString, _super); - function TimeSpanString() { - return _super !== null && _super.apply(this, arguments) || this; - } - TimeSpanString.Zero = "00:00:00"; - TimeSpanString.OneHour = "0.01:00:00"; - TimeSpanString.TenSeconds = "00:00:10"; - return TimeSpanString; -}(String)); -exports.TimeSpanString = TimeSpanString; -//# sourceMappingURL=timeSpan.js.map /***/ }), -/***/ 34170: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5549: +/***/ ((module) => { -"use strict"; +module.exports = addHook; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerActionCategory = void 0; -var TriggerActionCategory; -(function (TriggerActionCategory) { - TriggerActionCategory["Deployment"] = "Deployment"; - TriggerActionCategory["Runbook"] = "Runbook"; -})(TriggerActionCategory = exports.TriggerActionCategory || (exports.TriggerActionCategory = {})); -//# sourceMappingURL=triggerActionCategory.js.map +function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; + } -/***/ }), + if (kind === "before") { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)); + }; + } -/***/ 59636: -/***/ ((__unused_webpack_module, exports) => { + 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; + }); + }; + } -"use strict"; + if (kind === "error") { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options); + }); + }; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerActionResource = void 0; -var TriggerActionResource = (function () { - function TriggerActionResource() { - this.ActionType = undefined; - } - return TriggerActionResource; -}()); -exports.TriggerActionResource = TriggerActionResource; -//# sourceMappingURL=triggerActionResource.js.map + state.registry[name].push({ + hook: hook, + orig: orig, + }); +} -/***/ }), -/***/ 58574: -/***/ ((__unused_webpack_module, exports) => { +/***/ }), -"use strict"; +/***/ 44670: +/***/ ((module) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerActionType = void 0; -var TriggerActionType; -(function (TriggerActionType) { - TriggerActionType["AutoDeploy"] = "AutoDeploy"; - TriggerActionType["DeployLatestRelease"] = "DeployLatestRelease"; - TriggerActionType["DeployNewRelease"] = "DeployNewRelease"; - TriggerActionType["RunRunbook"] = "RunRunbook"; -})(TriggerActionType = exports.TriggerActionType || (exports.TriggerActionType = {})); -//# sourceMappingURL=triggerActionType.js.map +module.exports = register; -/***/ }), +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); + } -/***/ 1033: -/***/ ((__unused_webpack_module, exports) => { + if (!options) { + options = {}; + } -"use strict"; + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options); + }, method)(); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerFilterResource = void 0; -var TriggerFilterResource = (function () { - function TriggerFilterResource() { - this.FilterType = undefined; + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); } - return TriggerFilterResource; -}()); -exports.TriggerFilterResource = TriggerFilterResource; -//# sourceMappingURL=triggerFilterResource.js.map - -/***/ }), -/***/ 30292: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerFilterType = void 0; -var TriggerFilterType; -(function (TriggerFilterType) { - TriggerFilterType["CronExpressionSchedule"] = "CronExpressionSchedule"; - TriggerFilterType["ContinuousDailySchedule"] = "ContinuousDailySchedule"; - TriggerFilterType["DaysPerMonthSchedule"] = "DaysPerMonthSchedule"; - TriggerFilterType["MachineFilter"] = "MachineFilter"; - TriggerFilterType["OnceDailySchedule"] = "OnceDailySchedule"; -})(TriggerFilterType = exports.TriggerFilterType || (exports.TriggerFilterType = {})); -//# sourceMappingURL=triggerFilterType.js.map /***/ }), -/***/ 78010: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6819: +/***/ ((module) => { -"use strict"; +module.exports = removeHook; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isExistingTriggerResource = void 0; -function isExistingTriggerResource(resource) { - return resource.Links !== undefined; -} -exports.isExistingTriggerResource = isExistingTriggerResource; -//# sourceMappingURL=triggerResource.js.map +function removeHook(state, name, method) { + if (!state.registry[name]) { + return; + } -/***/ }), + var index = state.registry[name] + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); -/***/ 81599: -/***/ ((__unused_webpack_module, exports) => { + if (index === -1) { + return; + } -"use strict"; + state.registry[name].splice(index, 1); +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TriggerScheduleIntervalType = void 0; -var TriggerScheduleIntervalType; -(function (TriggerScheduleIntervalType) { - TriggerScheduleIntervalType["OnceDaily"] = "OnceDaily"; - TriggerScheduleIntervalType["OnceHourly"] = "OnceHourly"; - TriggerScheduleIntervalType["OnceEveryMinute"] = "OnceEveryMinute"; -})(TriggerScheduleIntervalType = exports.TriggerScheduleIntervalType || (exports.TriggerScheduleIntervalType = {})); -//# sourceMappingURL=triggerScheduleIntervalType.js.map /***/ }), -/***/ 54638: -/***/ ((__unused_webpack_module, exports) => { +/***/ 85443: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var util = __nccwpck_require__(73837); +var Stream = (__nccwpck_require__(12781).Stream); +var DelayedStream = __nccwpck_require__(18611); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UpgradeNotificationMode = void 0; -var UpgradeNotificationMode; -(function (UpgradeNotificationMode) { - UpgradeNotificationMode["AlwaysShow"] = "AlwaysShow"; - UpgradeNotificationMode["ShowOnlyMajorMinor"] = "ShowOnlyMajorMinor"; - UpgradeNotificationMode["NeverShow"] = "NeverShow"; -})(UpgradeNotificationMode = exports.UpgradeNotificationMode || (exports.UpgradeNotificationMode = {})); -//# sourceMappingURL=upgradeConfigurationResource.js.map +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; -/***/ }), + this._released = false; + this._streams = []; + this._currentStream = null; + this._insideLoop = false; + this._pendingNext = false; +} +util.inherits(CombinedStream, Stream); -/***/ 41823: -/***/ ((__unused_webpack_module, exports) => { +CombinedStream.create = function(options) { + var combinedStream = new this(); -"use strict"; + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=userAuthenticationResource.js.map + return combinedStream; +}; -/***/ }), +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; -/***/ 69838: -/***/ ((__unused_webpack_module, exports) => { +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); -"use strict"; + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=userIdentityMetadataResource.js.map + this._handleErrors(stream); -/***/ }), + if (this.pauseStreams) { + stream.pause(); + } + } -/***/ 45206: -/***/ ((__unused_webpack_module, exports) => { + this._streams.push(stream); + return this; +}; -"use strict"; +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAllProjectGroups = exports.isAllTenants = exports.isAllEnvironments = exports.isAllProjects = void 0; -function isAllProjects(restrictions) { - var allProjects = restrictions; - return (allProjects.length === 1 && - (allProjects[0] === "projects-all" || - allProjects[0] === "projects-unrelated")); -} -exports.isAllProjects = isAllProjects; -function isAllEnvironments(restrictions) { - var allEnvironments = restrictions; - return (allEnvironments.length === 1 && - (allEnvironments[0] === "environments-all" || - allEnvironments[0] === "environments-unrelated")); -} -exports.isAllEnvironments = isAllEnvironments; -function isAllTenants(restrictions) { - var allTenants = restrictions; - return (allTenants.length === 1 && - (allTenants[0] === "tenants-all" || allTenants[0] === "tenants-unrelated")); -} -exports.isAllTenants = isAllTenants; -function isAllProjectGroups(restrictions) { - var allProjectGroups = restrictions; - return (allProjectGroups.length === 1 && - (allProjectGroups[0] === "projectgroups-all" || - allProjectGroups[0] === "projectgroups-unrelated")); -} -exports.isAllProjectGroups = isAllProjectGroups; -//# sourceMappingURL=userPermissionRestriction.js.map +CombinedStream.prototype._getNext = function() { + this._currentStream = null; -/***/ }), + if (this._insideLoop) { + this._pendingNext = true; + return; // defer call + } -/***/ 36604: -/***/ ((__unused_webpack_module, exports) => { + this._insideLoop = true; + try { + do { + this._pendingNext = false; + this._realGetNext(); + } while (this._pendingNext); + } finally { + this._insideLoop = false; + } +}; -"use strict"; +CombinedStream.prototype._realGetNext = function() { + var stream = this._streams.shift(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=userPermissionSetResource.js.map -/***/ }), + if (typeof stream == 'undefined') { + this.end(); + return; + } -/***/ 50872: -/***/ ((__unused_webpack_module, exports) => { + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } -"use strict"; + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=userResource.js.map + this._pipeNext(stream); + }.bind(this)); +}; -/***/ }), +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; -/***/ 24456: -/***/ ((__unused_webpack_module, exports) => { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } -"use strict"; + var value = stream; + this.write(value); + this._getNext(); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UserRoleConstants = void 0; -exports.UserRoleConstants = { - SpaceManagerRole: "userroles-spacemanager", +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); }; -//# sourceMappingURL=userRoleResource.js.map -/***/ }), +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; -/***/ 54861: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } -"use strict"; + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NewUsernamePasswordAccount = void 0; -var accountType_1 = __nccwpck_require__(34914); -function NewUsernamePasswordAccount(name, username, password) { - return { - AccountType: accountType_1.AccountType.UsernamePassword, - Name: name, - Password: password, - Username: username, - }; -} -exports.NewUsernamePasswordAccount = NewUsernamePasswordAccount; -//# sourceMappingURL=usernamePasswordAccountResource.js.map +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } -/***/ }), + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; -/***/ 12765: -/***/ ((__unused_webpack_module, exports) => { +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; -"use strict"; +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPropertyDefinedAndNotNull = exports.typeSafeHasOwnProperty = void 0; -var typeSafeHasOwnProperty = function (target, key) { - return target.hasOwnProperty(key); +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; }; -exports.typeSafeHasOwnProperty = typeSafeHasOwnProperty; -var isPropertyDefinedAndNotNull = function (target, key) { - return ((0, exports.typeSafeHasOwnProperty)(target, key) && - target[key] !== null && - target[key] !== undefined); + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); }; -exports.isPropertyDefinedAndNotNull = isPropertyDefinedAndNotNull; -//# sourceMappingURL=utils.js.map -/***/ }), +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); -/***/ 7151: -/***/ ((__unused_webpack_module, exports) => { + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; -"use strict"; +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=variablePromptOptions.js.map /***/ }), -/***/ 90269: -/***/ ((__unused_webpack_module, exports) => { +/***/ 28222: +/***/ ((module, exports, __nccwpck_require__) => { -"use strict"; +/* eslint-env browser */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=variableResource.js.map +/** + * This is the web browser implementation of `debug()`. + */ -/***/ }), +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; -/***/ 32280: -/***/ ((__unused_webpack_module, exports) => { + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); -"use strict"; +/** + * Colors. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VariableSetContentType = void 0; -var VariableSetContentType; -(function (VariableSetContentType) { - VariableSetContentType["Variables"] = "Variables"; - VariableSetContentType["ScriptModule"] = "ScriptModule"; -})(VariableSetContentType = exports.VariableSetContentType || (exports.VariableSetContentType = {})); -//# sourceMappingURL=variableSetContentType.js.map +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; -/***/ }), +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ -/***/ 36186: -/***/ ((__unused_webpack_module, exports) => { +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } -"use strict"; + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=variableSetResource.js.map + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} -/***/ }), +/** + * Colorize log arguments if enabled. + * + * @api public + */ -/***/ 71283: -/***/ ((__unused_webpack_module, exports) => { +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); -"use strict"; + if (!this.useColors) { + return; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VariableType = void 0; -var VariableType; -(function (VariableType) { - VariableType["AmazonWebServicesAccount"] = "AmazonWebServicesAccount"; - VariableType["AzureAccount"] = "AzureAccount"; - VariableType["Certificate"] = "Certificate"; - VariableType["GoogleCloudAccount"] = "GoogleCloudAccount"; - VariableType["Sensitive"] = "Sensitive"; - VariableType["String"] = "String"; - VariableType["WorkerPool"] = "WorkerPool"; -})(VariableType = exports.VariableType || (exports.VariableType = {})); -//# sourceMappingURL=variableType.js.map + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); -/***/ }), + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); -/***/ 71879: -/***/ ((__unused_webpack_module, exports) => { + args.splice(lastC, 0, c); +} -"use strict"; +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=variablesScopedToEnvironmentResponse.js.map +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} -/***/ }), +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } -/***/ 63823: -/***/ ((__unused_webpack_module, exports) => { + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } -"use strict"; + return r; +} -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=vcsRunbookResourceLinks.js.map +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ -/***/ }), +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} -/***/ 94620: -/***/ ((__unused_webpack_module, exports) => { +module.exports = __nccwpck_require__(46243)(exports); -"use strict"; +const {formatters} = module.exports; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getBasePathToShowByDefault = exports.branchNameToShowByDefault = void 0; -exports.branchNameToShowByDefault = "main"; -var getBasePathToShowByDefault = function (projectName) { - return ".octopus/".concat(projectName); +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } }; -exports.getBasePathToShowByDefault = getBasePathToShowByDefault; -//# sourceMappingURL=versionControlledResource.js.map + /***/ }), -/***/ 82668: -/***/ ((__unused_webpack_module, exports) => { +/***/ 46243: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=versionRuleTestResponse.js.map +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ -/***/ }), +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(80900); + createDebug.destroy = destroy; -/***/ 51496: -/***/ ((__unused_webpack_module, exports) => { + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); -"use strict"; + /** + * The currently active debug mode names, and names to skip. + */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workItemLink.js.map + createDebug.names = []; + createDebug.skips = []; -/***/ }), + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; -/***/ 24090: -/***/ ((__unused_webpack_module, exports) => { + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; -"use strict"; + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWorkerMachine = void 0; -function isWorkerMachine(machine) { - return machine.WorkerPoolIds !== undefined; -} -exports.isWorkerMachine = isWorkerMachine; -//# sourceMappingURL=workerMachineResource.js.map + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; -/***/ }), + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; -/***/ 3282: -/***/ ((__unused_webpack_module, exports) => { + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } -"use strict"; + const self = debug; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolResource.js.map + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; -/***/ }), + args[0] = createDebug.coerce(args[0]); -/***/ 99028: -/***/ ((__unused_webpack_module, exports) => { + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } -"use strict"; + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolResourceBase.js.map + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); -/***/ }), + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); -/***/ 48773: -/***/ ((__unused_webpack_module, exports) => { + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } -"use strict"; + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolSummary.js.map + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } -/***/ }), + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); -/***/ 51578: -/***/ ((__unused_webpack_module, exports) => { + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } -"use strict"; + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolSummaryResource.js.map + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; -/***/ }), + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } -/***/ 30742: -/***/ ((__unused_webpack_module, exports) => { + namespaces = split[i].replace(/\*/g, '.*?'); -"use strict"; + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.WorkerPoolType = void 0; -var WorkerPoolType; -(function (WorkerPoolType) { - WorkerPoolType["Static"] = "StaticWorkerPool"; - WorkerPoolType["Dynamic"] = "DynamicWorkerPool"; -})(WorkerPoolType = exports.WorkerPoolType || (exports.WorkerPoolType = {})); -//# sourceMappingURL=workerPoolType.js.map + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } -/***/ }), + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } -/***/ 44021: -/***/ ((__unused_webpack_module, exports) => { + let i; + let len; -"use strict"; + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolsSummaryResource.js.map + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } -/***/ }), + return false; + } -/***/ 31613: -/***/ ((__unused_webpack_module, exports) => { + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } -"use strict"; + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerPoolsSupportedTypesResource.js.map + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } -/***/ }), + createDebug.enable(createDebug.load()); -/***/ 17678: -/***/ ((__unused_webpack_module, exports) => { + return createDebug; +} -"use strict"; +module.exports = setup; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=workerToolsLatestImages.js.map /***/ }), -/***/ 14812: +/***/ 38237: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = -{ - parallel : __nccwpck_require__(8210), - serial : __nccwpck_require__(50445), - serialOrdered : __nccwpck_require__(3578) -}; +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(28222); +} else { + module.exports = __nccwpck_require__(35332); +} -/***/ }), -/***/ 1700: -/***/ ((module) => { +/***/ }), -// API -module.exports = abort; +/***/ 35332: +/***/ ((module, exports, __nccwpck_require__) => { /** - * Aborts leftover active jobs - * - * @param {object} state - current state object + * Module dependencies. */ -function abort(state) -{ - Object.keys(state.jobs).forEach(clean.bind(state)); - // reset leftover jobs - state.jobs = {}; -} +const tty = __nccwpck_require__(76224); +const util = __nccwpck_require__(73837); /** - * Cleans up leftover job by invoking abort function for the provided job id - * - * @this state - * @param {string|number} key - job id to abort + * This is the Node.js implementation of `debug()`. */ -function clean(key) -{ - if (typeof this.jobs[key] == 'function') - { - this.jobs[key](); - } -} +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); -/***/ }), +/** + * Colors. + */ -/***/ 72794: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +exports.colors = [6, 2, 3, 4, 5, 1]; -var defer = __nccwpck_require__(15295); +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(59318); -// API -module.exports = async; + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} /** - * Runs provided callback asynchronously - * even if callback itself is not + * Build up the default `inspectOpts` object from the environment variables. * - * @param {function} callback - callback to invoke - * @returns {function} - augmented callback + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ -function async(callback) -{ - var isAsync = false; - - // check if async happened - defer(function() { isAsync = true; }); - return function async_callback(err, result) - { - if (isAsync) - { - callback(err, result); - } - else - { - defer(function nextTick_callback() - { - callback(err, result); - }); - } - }; -} +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } -/***/ }), + obj[prop] = val; + return obj; +}, {}); -/***/ 15295: -/***/ ((module) => { +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ -module.exports = defer; +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} /** - * Runs provided function on next iteration of the event loop + * Adds ANSI color escape codes if enabled. * - * @param {function} fn - function to run + * @api public */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); - } -} +function formatArgs(args) { + const {namespace: name, useColors} = this; + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; -/***/ }), + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} -/***/ 9023: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} -var async = __nccwpck_require__(72794) - , abort = __nccwpck_require__(1700) - ; +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ -// API -module.exports = iterate; +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} /** - * Iterates over each job object + * Save `namespaces`. * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {object} state - current job status - * @param {function} callback - invoked when all elements processed + * @param {String} namespaces + * @api private */ -function iterate(list, iterator, state, callback) -{ - // store current index - var key = state['keyedList'] ? state['keyedList'][state.index] : state.index; - - state.jobs[key] = runJob(iterator, key, list[key], function(error, output) - { - // don't repeat yourself - // skip secondary callbacks - if (!(key in state.jobs)) - { - return; - } - - // clean up jobs - delete state.jobs[key]; - - if (error) - { - // don't process rest of the results - // stop still active jobs - // and reset the list - abort(state); - } - else - { - state.results[key] = output; - } - - // return salvaged results - callback(error, state.results); - }); +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } } /** - * Runs iterator over provided job element + * Load `namespaces`. * - * @param {function} iterator - iterator to invoke - * @param {string|number} key - key/index of the element in the list of jobs - * @param {mixed} item - job description - * @param {function} callback - invoked after iterator is done with the job - * @returns {function|mixed} - job abort function or something else + * @return {String} returns the previously persisted debug modes + * @api private */ -function runJob(iterator, key, item, callback) -{ - var aborter; - - // allow shortcut if iterator expects only two arguments - if (iterator.length == 2) - { - aborter = iterator(item, async(callback)); - } - // otherwise go with full three arguments - else - { - aborter = iterator(item, key, async(callback)); - } - return aborter; +function load() { + return process.env.DEBUG; } - -/***/ }), - -/***/ 42474: -/***/ ((module) => { - -// API -module.exports = state; - /** - * Creates initial state object - * for iteration over list + * Init logic for `debug` instances. * - * @param {array|object} list - list to iterate over - * @param {function|null} sortMethod - function to use for keys sort, - * or `null` to keep them as is - * @returns {object} - initial state object + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. */ -function state(list, sortMethod) -{ - var isNamedList = !Array.isArray(list) - , initState = - { - index : 0, - keyedList: isNamedList || sortMethod ? Object.keys(list) : null, - jobs : {}, - results : isNamedList ? {} : [], - size : isNamedList ? Object.keys(list).length : list.length - } - ; - if (sortMethod) - { - // sort array keys based on it's values - // sort object's keys just on own merit - initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) - { - return sortMethod(list[a], list[b]); - }); - } +function init(debug) { + debug.inspectOpts = {}; - return initState; + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } } +module.exports = __nccwpck_require__(46243)(exports); -/***/ }), - -/***/ 37942: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +const {formatters} = module.exports; -var abort = __nccwpck_require__(1700) - , async = __nccwpck_require__(72794) - ; +/** + * Map %o to `util.inspect()`, all on a single line. + */ -// API -module.exports = terminator; +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; /** - * Terminates jobs in the attached state context - * - * @this AsyncKitState# - * @param {function} callback - final callback to invoke after termination + * Map %O to `util.inspect()`, allowing multiple lines if needed. */ -function terminator(callback) -{ - if (!Object.keys(this.jobs).length) - { - return; - } - // fast forward iteration index - this.index = this.size; +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; - // abort jobs - abort(this); - // send back results we have so far - async(callback)(null, this.results); +/***/ }), + +/***/ 18611: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Stream = (__nccwpck_require__(12781).Stream); +var util = __nccwpck_require__(73837); + +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; } +util.inherits(DelayedStream, Stream); +DelayedStream.create = function(source, options) { + var delayedStream = new this(); -/***/ }), + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } -/***/ 8210: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + delayedStream.source = source; -var iterate = __nccwpck_require__(9023) - , initState = __nccwpck_require__(42474) - , terminator = __nccwpck_require__(37942) - ; + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; -// Public API -module.exports = parallel; + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); + return delayedStream; +}; - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; - state.index++; +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); } - return terminator.bind(state, callback); -} + this.source.resume(); +}; +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; -/***/ }), +DelayedStream.prototype.release = function() { + this._released = true; -/***/ 50445: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; -var serialOrdered = __nccwpck_require__(3578); +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; -// Public API -module.exports = serial; +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } -/** - * Runs iterator over provided array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); -} + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } + this._bufferedEvents.push(args); +}; -/***/ }), +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } -/***/ 3578: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (this.dataSize <= this.maxDataSize) { + return; + } -var iterate = __nccwpck_require__(9023) - , initState = __nccwpck_require__(42474) - , terminator = __nccwpck_require__(37942) - ; + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); +}; -// Public API -module.exports = serialOrdered; -// sorting helpers -module.exports.ascending = ascending; -module.exports.descending = descending; -/** - * Runs iterator over provided sorted array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} sortMethod - custom sort function - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serialOrdered(list, iterator, sortMethod, callback) -{ - var state = initState(list, sortMethod); +/***/ }), - iterate(list, iterator, state, function iteratorHandler(error, result) - { - if (error) - { - callback(error, result); - return; - } +/***/ 58932: +/***/ ((__unused_webpack_module, exports) => { - state.index++; +"use strict"; - // are we there yet? - if (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, iteratorHandler); - return; - } - // done here - callback(null, state.results); - }); +Object.defineProperty(exports, "__esModule", ({ value: true })); - return terminator.bind(state, callback); -} +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) -/* - * -- Sort methods - */ + /* istanbul ignore next */ -/** - * sort helper to sort array elements in ascending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function ascending(a, b) -{ - return a < b ? -1 : a > b ? 1 : 0; -} + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = 'Deprecation'; + } -/** - * sort helper to sort array elements in descending order - * - * @param {mixed} a - an item to compare - * @param {mixed} b - an item to compare - * @returns {number} - comparison result - */ -function descending(a, b) -{ - return -1 * ascending(a, b); } +exports.Deprecation = Deprecation; + /***/ }), -/***/ 96545: +/***/ 31133: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(52618); +var debug; -/***/ }), +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = __nccwpck_require__(38237)("follow-redirects"); + } + catch (error) { /* */ } + if (typeof debug !== "function") { + debug = function () { /* */ }; + } + } + debug.apply(null, arguments); +}; -/***/ 68104: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +/***/ }), +/***/ 67707: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var utils = __nccwpck_require__(20328); -var settle = __nccwpck_require__(13211); -var buildFullPath = __nccwpck_require__(41934); -var buildURL = __nccwpck_require__(30646); +var url = __nccwpck_require__(57310); +var URL = url.URL; var http = __nccwpck_require__(13685); var https = __nccwpck_require__(95687); -var httpFollow = (__nccwpck_require__(67707).http); -var httpsFollow = (__nccwpck_require__(67707).https); -var url = __nccwpck_require__(57310); -var zlib = __nccwpck_require__(59796); -var VERSION = (__nccwpck_require__(94322).version); -var transitionalDefaults = __nccwpck_require__(40936); -var AxiosError = __nccwpck_require__(72093); -var CanceledError = __nccwpck_require__(34098); +var Writable = (__nccwpck_require__(12781).Writable); +var assert = __nccwpck_require__(39491); +var debug = __nccwpck_require__(31133); -var isHttps = /https:?/; +// Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; +var eventHandlers = Object.create(null); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; +}); -var supportedProtocols = [ 'http:', 'https:', 'file:' ]; +// Error types with codes +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded" +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); -/** - * - * @param {http.ClientRequestArgs} options - * @param {AxiosProxyConfig} proxy - * @param {string} location - */ -function setProxy(options, proxy, location) { - options.hostname = proxy.host; - options.host = proxy.host; - options.port = proxy.port; - options.path = location; +// An HTTP(S) request that can be redirected +function RedirectableRequest(options, responseCallback) { + // Initialize the request + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; - // Basic proxy authorization - if (proxy.auth) { - var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); - options.headers['Proxy-Authorization'] = 'Basic ' + base64; + // Attach a callback if passed + if (responseCallback) { + this.on("response", responseCallback); } - // If a proxy is used, any redirects must also pass through the proxy - options.beforeRedirect = function beforeRedirect(redirection) { - redirection.headers.host = redirection.host; - setProxy(redirection, proxy, redirection.href); + // React to responses of native requests + var self = this; + this._onNativeResponse = function (response) { + self._processResponse(response); }; + + // Perform the first request + this._performRequest(); } +RedirectableRequest.prototype = Object.create(Writable.prototype); -/*eslint consistent-return:0*/ -module.exports = function httpAdapter(config) { - return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { - var onCanceled; - function done() { - if (config.cancelToken) { - config.cancelToken.unsubscribe(onCanceled); - } +RedirectableRequest.prototype.abort = function () { + abortRequest(this._currentRequest); + this.emit("abort"); +}; - if (config.signal) { - config.signal.removeEventListener('abort', onCanceled); - } - } - var resolve = function resolve(value) { - done(); - resolvePromise(value); - }; - var rejected = false; - var reject = function reject(value) { - done(); - rejected = true; - rejectPromise(value); - }; - var data = config.data; - var headers = config.headers; - var headerNames = {}; +// Writes buffered data to the current native request +RedirectableRequest.prototype.write = function (data, encoding, callback) { + // Writing is not allowed if end has been called + if (this._ending) { + throw new WriteAfterEndError(); + } - Object.keys(headers).forEach(function storeLowerName(name) { - headerNames[name.toLowerCase()] = name; - }); + // Validate input and shift parameters if necessary + if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (typeof encoding === "function") { + callback = encoding; + encoding = null; + } - // Set User-Agent (required by some servers) - // See https://github.com/axios/axios/issues/69 - if ('user-agent' in headerNames) { - // User-Agent is specified; handle case where no UA header is desired - if (!headers[headerNames['user-agent']]) { - delete headers[headerNames['user-agent']]; - } - // Otherwise, use specified value - } else { - // Only set header if it hasn't been set in config - headers['User-Agent'] = 'axios/' + VERSION; + // Ignore empty buffers, since writing them doesn't invoke the callback + // https://github.com/nodejs/node/issues/22066 + if (data.length === 0) { + if (callback) { + callback(); } + return; + } + // Only write when we don't exceed the maximum body length + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data: data, encoding: encoding }); + this._currentRequest.write(data, encoding, callback); + } + // Error when we exceed the maximum body length + else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); + } +}; - // support for https://www.npmjs.com/package/form-data api - if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { - Object.assign(headers, data.getHeaders()); - } else if (data && !utils.isStream(data)) { - if (Buffer.isBuffer(data)) { - // Nothing to do... - } else if (utils.isArrayBuffer(data)) { - data = Buffer.from(new Uint8Array(data)); - } else if (utils.isString(data)) { - data = Buffer.from(data, 'utf-8'); - } else { - return reject(new AxiosError( - 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', - AxiosError.ERR_BAD_REQUEST, - config - )); - } +// Ends the current native request +RedirectableRequest.prototype.end = function (data, encoding, callback) { + // Shift parameters if necessary + if (typeof data === "function") { + callback = data; + data = encoding = null; + } + else if (typeof encoding === "function") { + callback = encoding; + encoding = null; + } - if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { - return reject(new AxiosError( - 'Request body larger than maxBodyLength limit', - AxiosError.ERR_BAD_REQUEST, - config - )); - } + // Write data if needed and end + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } + else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function () { + self._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } +}; - // Add Content-Length header if data exists - if (!headerNames['content-length']) { - headers['Content-Length'] = data.length; - } - } +// Sets a header value on the current native request +RedirectableRequest.prototype.setHeader = function (name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); +}; - // HTTP basic authentication - var auth = undefined; - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password || ''; - auth = username + ':' + password; - } +// Clears a header value on the current native request +RedirectableRequest.prototype.removeHeader = function (name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); +}; - // Parse url - var fullPath = buildFullPath(config.baseURL, config.url); - var parsed = url.parse(fullPath); - var protocol = parsed.protocol || supportedProtocols[0]; +// Global timeout for all underlying requests +RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; - if (supportedProtocols.indexOf(protocol) === -1) { - return reject(new AxiosError( - 'Unsupported protocol ' + protocol, - AxiosError.ERR_BAD_REQUEST, - config - )); + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } + + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } - if (!auth && parsed.auth) { - var urlAuth = parsed.auth.split(':'); - var urlUsername = urlAuth[0] || ''; - var urlPassword = urlAuth[1] || ''; - auth = urlUsername + ':' + urlPassword; + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; } - if (auth && headerNames.authorization) { - delete headers[headerNames.authorization]; + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); } + } - var isHttpsRequest = isHttps.test(protocol); - var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + // Attach callback if passed + if (callback) { + this.on("timeout", callback); + } - try { - buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''); - } catch (err) { - var customErr = new Error(err.message); - customErr.config = config; - customErr.url = config.url; - customErr.exists = true; - reject(customErr); - } + // Start the timer if or when the socket is opened + if (this.socket) { + startTimer(this.socket); + } + else { + this._currentRequest.once("socket", startTimer); + } - var options = { - path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), - method: config.method.toUpperCase(), - headers: headers, - agent: agent, - agents: { http: config.httpAgent, https: config.httpsAgent }, - auth: auth - }; + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); - if (config.socketPath) { - options.socketPath = config.socketPath; - } else { - options.hostname = parsed.hostname; - options.port = parsed.port; + return this; +}; + +// Proxy all other public ClientRequest methods +[ + "flushHeaders", "getHeader", + "setNoDelay", "setSocketKeepAlive", +].forEach(function (method) { + RedirectableRequest.prototype[method] = function (a, b) { + return this._currentRequest[method](a, b); + }; +}); + +// Proxy all public ClientRequest properties +["aborted", "connection", "socket"].forEach(function (property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function () { return this._currentRequest[property]; }, + }); +}); + +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; + } + + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; } + delete options.host; + } - var proxy = config.proxy; - if (!proxy && proxy !== false) { - var proxyEnv = protocol.slice(0, -1) + '_proxy'; - var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; - if (proxyUrl) { - var parsedProxyUrl = url.parse(proxyUrl); - var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; - var shouldProxy = true; + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } + } +}; - if (noProxyEnv) { - var noProxy = noProxyEnv.split(',').map(function trim(s) { - return s.trim(); - }); - shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { - if (!proxyElement) { - return false; - } - if (proxyElement === '*') { - return true; - } - if (proxyElement[0] === '.' && - parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { - return true; - } +// Executes the next native request (initial or redirect) +RedirectableRequest.prototype._performRequest = function () { + // Load the native protocol + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + this.emit("error", new TypeError("Unsupported protocol " + protocol)); + return; + } - return parsed.hostname === proxyElement; - }); - } + // If specified, use the agent corresponding to the protocol + // (HTTP and HTTPS use different types of agents) + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } - if (shouldProxy) { - proxy = { - host: parsedProxyUrl.hostname, - port: parsedProxyUrl.port, - protocol: parsedProxyUrl.protocol - }; + // Create the native request and set up its event handlers + var request = this._currentRequest = + nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } - if (parsedProxyUrl.auth) { - var proxyUrlAuth = parsedProxyUrl.auth.split(':'); - proxy.auth = { - username: proxyUrlAuth[0], - password: proxyUrlAuth[1] - }; + // RFC7230§5.3.1: When making a request directly to an origin server, […] + // a client MUST send only the absolute path […] as the request-target. + this._currentUrl = /^\//.test(this._options.path) ? + url.format(this._options) : + // When making a request to a proxy, […] + // a client MUST send the target URI in absolute-form […]. + this._currentUrl = this._options.path; + + // End a redirected request + // (The first request must be ended explicitly with RedirectableRequest#end) + if (this._isRedirect) { + // Write the request entity and end + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + // Only write if this request has not been redirected yet + /* istanbul ignore else */ + if (request === self._currentRequest) { + // Report any write errors + /* istanbul ignore if */ + if (error) { + self.emit("error", error); + } + // Write the next buffer if there are still left + else if (i < buffers.length) { + var buffer = buffers[i++]; + /* istanbul ignore else */ + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); } } + // End the request if `end` has been called on us + else if (self._ended) { + request.end(); + } } - } + }()); + } +}; - if (proxy) { - options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); - setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); - } +// Processes a response from the current native request +RedirectableRequest.prototype._processResponse = function (response) { + // Store the redirected response + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode: statusCode, + }); + } - var transport; - var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); - if (config.transport) { - transport = config.transport; - } else if (config.maxRedirects === 0) { - transport = isHttpsProxy ? https : http; - } else { - if (config.maxRedirects) { - options.maxRedirects = config.maxRedirects; - } - if (config.beforeRedirect) { - options.beforeRedirect = config.beforeRedirect; - } - transport = isHttpsProxy ? httpsFollow : httpFollow; - } + // RFC7231§6.4: The 3xx (Redirection) class of status code indicates + // that further action needs to be taken by the user agent in order to + // fulfill the request. If a Location header field is provided, + // the user agent MAY automatically redirect its request to the URI + // referenced by the Location field value, + // even if the specific status code is not understood. - if (config.maxBodyLength > -1) { - options.maxBodyLength = config.maxBodyLength; - } + // If the response is not a redirect; return it as-is + var location = response.headers.location; + if (!location || this._options.followRedirects === false || + statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); - if (config.insecureHTTPParser) { - options.insecureHTTPParser = config.insecureHTTPParser; - } + // Clean up + this._requestBodyBuffers = []; + return; + } - // Create the request - var req = transport.request(options, function handleResponse(res) { - if (req.aborted) return; + // The response is a redirect, so abort the current request + abortRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); - // uncompress the response body transparently if required - var stream = res; + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + this.emit("error", new TooManyRedirectsError()); + return; + } - // return the last request in case of redirects - var lastRequest = res.req || req; + // Store the request headers if applicable + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host"), + }, this._options.headers); + } + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } - // if no content, is HEAD request or decompress disabled we should not decompress - if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { - switch (res.headers['content-encoding']) { - /*eslint default-case:0*/ - case 'gzip': - case 'compress': - case 'deflate': - // add the unzipper to the body stream processing pipeline - stream = stream.pipe(zlib.createUnzip()); + // Drop the Host header, as the redirect might lead to a different host + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); - // remove the content-encoding in order to not confuse downstream operations - delete res.headers['content-encoding']; - break; - } - } + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = url.parse(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); - var response = { - status: res.statusCode, - statusText: res.statusMessage, - headers: res.headers, - config: config, - request: lastRequest - }; + // Determine the URL of the redirection + var redirectUrl; + try { + redirectUrl = url.resolve(currentUrl, location); + } + catch (cause) { + this.emit("error", new RedirectionError(cause)); + return; + } - if (config.responseType === 'stream') { - response.data = stream; - settle(resolve, reject, response); - } else { - var responseBuffer = []; - var totalResponseBytes = 0; - stream.on('data', function handleStreamData(chunk) { - responseBuffer.push(chunk); - totalResponseBytes += chunk.length; + // Create the redirected request + debug("redirecting to", redirectUrl); + this._isRedirect = true; + var redirectUrlParts = url.parse(redirectUrl); + Object.assign(this._options, redirectUrlParts); - // make sure the content length is not over the maxContentLength if specified - if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { - // stream.destoy() emit aborted event before calling reject() on Node.js v16 - rejected = true; - stream.destroy(); - reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); - } - }); + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if (redirectUrlParts.protocol !== currentUrlParts.protocol && + redirectUrlParts.protocol !== "https:" || + redirectUrlParts.host !== currentHost && + !isSubdomain(redirectUrlParts.host, currentHost)) { + removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); + } - stream.on('aborted', function handlerStreamAborted() { - if (rejected) { - return; - } - stream.destroy(); - reject(new AxiosError( - 'maxContentLength size of ' + config.maxContentLength + ' exceeded', - AxiosError.ERR_BAD_RESPONSE, - config, - lastRequest - )); - }); + // Evaluate the beforeRedirect callback + if (typeof beforeRedirect === "function") { + var responseDetails = { + headers: response.headers, + statusCode: statusCode, + }; + var requestDetails = { + url: currentUrl, + method: method, + headers: requestHeaders, + }; + try { + beforeRedirect(this._options, responseDetails, requestDetails); + } + catch (err) { + this.emit("error", err); + return; + } + this._sanitizeOptions(this._options); + } - stream.on('error', function handleStreamError(err) { - if (req.aborted) return; - reject(AxiosError.from(err, null, config, lastRequest)); - }); + // Perform the redirected request + try { + this._performRequest(); + } + catch (cause) { + this.emit("error", new RedirectionError(cause)); + } +}; - stream.on('end', function handleStreamEnd() { - try { - var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); - if (config.responseType !== 'arraybuffer') { - responseData = responseData.toString(config.responseEncoding); - if (!config.responseEncoding || config.responseEncoding === 'utf8') { - responseData = utils.stripBOM(responseData); - } - } - response.data = responseData; - } catch (err) { - reject(AxiosError.from(err, null, config, response.request, response)); - } - settle(resolve, reject, response); - }); +// Wraps the key/value object of protocols with redirect functionality +function wrap(protocols) { + // Default settings + var exports = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024, + }; + + // Wrap each protocol + var nativeProtocols = {}; + Object.keys(protocols).forEach(function (scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); + + // Executes a request, following redirects + function request(input, options, callback) { + // Parse parameters + if (typeof input === "string") { + var urlStr = input; + try { + input = urlToOptions(new URL(urlStr)); + } + catch (err) { + /* istanbul ignore next */ + input = url.parse(urlStr); + } + } + else if (URL && (input instanceof URL)) { + input = urlToOptions(input); + } + else { + callback = options; + options = input; + input = { protocol: protocol }; + } + if (typeof options === "function") { + callback = options; + options = null; } - }); - - // Handle errors - req.on('error', function handleRequestError(err) { - // @todo remove - // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; - reject(AxiosError.from(err, null, config, req)); - }); - // set tcp keep alive to prevent drop connection by peer - req.on('socket', function handleRequestSocket(socket) { - // default interval of sending ack packet is 1 minute - socket.setKeepAlive(true, 1000 * 60); - }); + // Set defaults + options = Object.assign({ + maxRedirects: exports.maxRedirects, + maxBodyLength: exports.maxBodyLength, + }, input, options); + options.nativeProtocols = nativeProtocols; - // Handle request timeout - if (config.timeout) { - // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. - var timeout = parseInt(config.timeout, 10); + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); + } - if (isNaN(timeout)) { - reject(new AxiosError( - 'error trying to parse `config.timeout` to int', - AxiosError.ERR_BAD_OPTION_VALUE, - config, - req - )); + // Executes a GET request, following redirects + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } - return; - } + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); + }); + return exports; +} - // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. - // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. - // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. - // And then these socket which be hang up will devoring CPU little by little. - // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. - req.setTimeout(timeout, function handleRequestTimeout() { - req.abort(); - var transitional = config.transitional || transitionalDefaults; - reject(new AxiosError( - 'timeout of ' + timeout + 'ms exceeded', - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - req - )); - }); - } +/* istanbul ignore next */ +function noop() { /* empty */ } - if (config.cancelToken || config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = function(cancel) { - if (req.aborted) return; +// from https://github.com/nodejs/node/blob/master/lib/internal/url.js +function urlToOptions(urlObject) { + var options = { + protocol: urlObject.protocol, + hostname: urlObject.hostname.startsWith("[") ? + /* istanbul ignore next */ + urlObject.hostname.slice(1, -1) : + urlObject.hostname, + hash: urlObject.hash, + search: urlObject.search, + pathname: urlObject.pathname, + path: urlObject.pathname + urlObject.search, + href: urlObject.href, + }; + if (urlObject.port !== "") { + options.port = Number(urlObject.port); + } + return options; +} - req.abort(); - reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); - }; +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; + } + } + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); +} - config.cancelToken && config.cancelToken.subscribe(onCanceled); - if (config.signal) { - config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); - } +function createErrorType(code, defaultMessage) { + function CustomError(cause) { + Error.captureStackTrace(this, this.constructor); + if (!cause) { + this.message = defaultMessage; + } + else { + this.message = defaultMessage + ": " + cause.message; + this.cause = cause; } + } + CustomError.prototype = new Error(); + CustomError.prototype.constructor = CustomError; + CustomError.prototype.name = "Error [" + code + "]"; + CustomError.prototype.code = code; + return CustomError; +} + +function abortRequest(request) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.abort(); +} +function isSubdomain(subdomain, domain) { + const dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); +} - // Send the request - if (utils.isStream(data)) { - data.on('error', function handleStreamError(err) { - reject(AxiosError.from(err, config, null, req)); - }).pipe(req); - } else { - req.end(data); - } - }); -}; +// Exports +module.exports = wrap({ http: http, https: https }); +module.exports.wrap = wrap; /***/ }), -/***/ 3454: +/***/ 64334: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var CombinedStream = __nccwpck_require__(85443); +var util = __nccwpck_require__(73837); +var path = __nccwpck_require__(71017); +var http = __nccwpck_require__(13685); +var https = __nccwpck_require__(95687); +var parseUrl = (__nccwpck_require__(57310).parse); +var fs = __nccwpck_require__(57147); +var Stream = (__nccwpck_require__(12781).Stream); +var mime = __nccwpck_require__(43583); +var asynckit = __nccwpck_require__(14812); +var populate = __nccwpck_require__(17142); +// Public API +module.exports = FormData; -var utils = __nccwpck_require__(20328); -var settle = __nccwpck_require__(13211); -var cookies = __nccwpck_require__(21545); -var buildURL = __nccwpck_require__(30646); -var buildFullPath = __nccwpck_require__(41934); -var parseHeaders = __nccwpck_require__(86455); -var isURLSameOrigin = __nccwpck_require__(33608); -var transitionalDefaults = __nccwpck_require__(40936); -var AxiosError = __nccwpck_require__(72093); -var CanceledError = __nccwpck_require__(34098); -var parseProtocol = __nccwpck_require__(66107); +// make it a Stream +util.inherits(FormData, CombinedStream); -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - var responseType = config.responseType; - var onCanceled; - function done() { - if (config.cancelToken) { - config.cancelToken.unsubscribe(onCanceled); - } +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream + */ +function FormData(options) { + if (!(this instanceof FormData)) { + return new FormData(options); + } - if (config.signal) { - config.signal.removeEventListener('abort', onCanceled); - } - } + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; - if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) { - delete requestHeaders['Content-Type']; // Let the browser set it - } + CombinedStream.call(this); - var request = new XMLHttpRequest(); + options = options || {}; + for (var option in options) { + this[option] = options[option]; + } +} - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; - var fullPath = buildFullPath(config.baseURL, config.url); +FormData.prototype.append = function(field, value, options) { - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + options = options || {}; - // Set the request timeout in MS - request.timeout = config.timeout; + // allow filename as single option + if (typeof options == 'string') { + options = {filename: options}; + } - function onloadend() { - if (!request) { - return; - } - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !responseType || responseType === 'text' || responseType === 'json' ? - request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; + var append = CombinedStream.prototype.append.bind(this); - settle(function _resolve(value) { - resolve(value); - done(); - }, function _reject(err) { - reject(err); - done(); - }, response); + // all that streamy business can't handle numbers + if (typeof value == 'number') { + value = '' + value; + } - // Clean up request - request = null; - } + // https://github.com/felixge/node-form-data/issues/38 + if (util.isArray(value)) { + // Please convert your array into string + // the way web server expects it + this._error(new Error('Arrays are not supported.')); + return; + } - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } + append(header); + append(value); + append(footer); - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } + // pass along options.knownLength + this._trackLength(header, value, options); +}; - reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); +FormData.prototype._trackLength = function(header, value, options) { + var valueLength = 0; - // Clean up request - request = null; - }; + // used w/ getLengthSync(), when length is known. + // e.g. for streaming directly from a remote server, + // w/ a known file a size, and not wanting to wait for + // incoming file to finish to get its size. + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); + } - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request)); + this._valueLength += valueLength; - // Clean up request - request = null; - }; + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += + Buffer.byteLength(header) + + FormData.LINE_BREAK.length; - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; - var transitional = config.transitional || transitionalDefaults; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(new AxiosError( - timeoutErrorMessage, - transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, - config, - request)); + // empty or either doesn't have path or not an http response or not a stream + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { + return; + } - // Clean up request - request = null; - }; + // no need to bother with the length + if (!options.knownLength) { + this._valuesToMeasure.push(value); + } +}; - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; +FormData.prototype._lengthRetriever = function(value, callback) { - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } + if (value.hasOwnProperty('fd')) { - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { + + // when end specified + // no need to calculate range + // inclusive, starts with 0 + callback(null, value.end + 1 - (value.start ? value.start : 0)); + + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function(err, stat) { + + var fileSize; + + if (err) { + callback(err); + return; } + + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); }); } - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + callback(null, +value.headers['content-length']); - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = config.responseType; - } + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + callback(null, +response.headers['content-length']); + }); + value.resume(); - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } + // something else + } else { + callback('Unknown stream'); + } +}; - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } +FormData.prototype._multiPartHeader = function(field, value, options) { + // custom header specified (as string)? + // it becomes responsible for boundary + // (e.g. to handle extra CRLFs on .NET servers) + if (typeof options.header == 'string') { + return options.header; + } - if (config.cancelToken || config.signal) { - // Handle cancellation - // eslint-disable-next-line func-names - onCanceled = function(cancel) { - if (!request) { - return; - } - reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel); - request.abort(); - request = null; - }; + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); - config.cancelToken && config.cancelToken.subscribe(onCanceled); - if (config.signal) { - config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); - } - } + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; - if (!requestData) { - requestData = null; - } + // allow custom headers. + if (typeof options.header == 'object') { + populate(headers, options.header); + } - var protocol = parseProtocol(fullPath); + var header; + for (var prop in headers) { + if (!headers.hasOwnProperty(prop)) continue; + header = headers[prop]; - if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) { - reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); - return; + // skip nullish headers. + if (header == null) { + continue; + } + + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; } + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + } + } - // Send the request - request.send(requestData); - }); + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; }; +FormData.prototype._getContentDisposition = function(value, options) { -/***/ }), + var filename + , contentDisposition + ; -/***/ 52618: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || value.name || value.path) { + // custom filename take precedence + // formidable and the browser add a name property + // fs- and request- streams have path property + filename = path.basename(options.filename || value.name || value.path); + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path || ''); + } -"use strict"; + if (filename) { + contentDisposition = 'filename="' + filename + '"'; + } + return contentDisposition; +}; -var utils = __nccwpck_require__(20328); -var bind = __nccwpck_require__(77065); -var Axios = __nccwpck_require__(98178); -var mergeConfig = __nccwpck_require__(74831); -var defaults = __nccwpck_require__(21626); +FormData.prototype._getContentType = function(value, options) { -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); + // use custom content-type above all + var contentType = options.contentType; - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); + // or try `name` from formidable, browser + if (!contentType && value.name) { + contentType = mime.lookup(value.name); + } - // Copy context to instance - utils.extend(instance, context); + // or try `path` from fs-, request- streams + if (!contentType && value.path) { + contentType = mime.lookup(value.path); + } - // Factory for creating new instances - instance.create = function create(instanceConfig) { - return createInstance(mergeConfig(defaultConfig, instanceConfig)); - }; + // or if it's http-reponse + if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { + contentType = value.headers['content-type']; + } - return instance; -} + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } -// Create the default instance to be exported -var axios = createInstance(defaults); + // fallback to the default content type if `value` is not simple value + if (!contentType && typeof value == 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } -// Expose Axios class to allow class inheritance -axios.Axios = Axios; + return contentType; +}; -// Expose Cancel & CancelToken -axios.CanceledError = __nccwpck_require__(34098); -axios.CancelToken = __nccwpck_require__(71587); -axios.isCancel = __nccwpck_require__(64057); -axios.VERSION = (__nccwpck_require__(94322).version); -axios.toFormData = __nccwpck_require__(20470); +FormData.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData.LINE_BREAK; -// Expose AxiosError class -axios.AxiosError = __nccwpck_require__(72093); + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); + } -// alias for CanceledError for backward compatibility -axios.Cancel = axios.CanceledError; + next(footer); + }.bind(this); +}; -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; }; -axios.spread = __nccwpck_require__(74850); -// Expose isAxiosError -axios.isAxiosError = __nccwpck_require__(60650); +FormData.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; -module.exports = axios; + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } -// Allow use of default import syntax in TypeScript -module.exports["default"] = axios; + return formHeaders; +}; +FormData.prototype.setBoundary = function(boundary) { + this._boundary = boundary; +}; -/***/ }), +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } -/***/ 71587: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + return this._boundary; +}; -"use strict"; +FormData.prototype.getBuffer = function() { + var dataBuffer = new Buffer.alloc( 0 ); + var boundary = this.getBoundary(); + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { -var CanceledError = __nccwpck_require__(34098); + // Add content to the buffer. + if(Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); + }else { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); + } -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { + dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); + } + } } - var resolvePromise; + // Add the footer and return the Buffer object. + return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); +}; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } - var token = this; + this._boundary = boundary; +}; - // eslint-disable-next-line func-names - this.promise.then(function(cancel) { - if (!token._listeners) return; +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; - var i; - var l = token._listeners.length; + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } - for (i = 0; i < l; i++) { - token._listeners[i](cancel); - } - token._listeners = null; - }); + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + // Some async length retrievers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } - // eslint-disable-next-line func-names - this.promise.then = function(onfulfilled) { - var _resolve; - // eslint-disable-next-line func-names - var promise = new Promise(function(resolve) { - token.subscribe(resolve); - _resolve = resolve; - }).then(onfulfilled); + return knownLength; +}; - promise.cancel = function reject() { - token.unsubscribe(_resolve); - }; +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function() { + var hasKnownLength = true; - return promise; - }; + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested + return hasKnownLength; +}; + +FormData.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { + if (err) { + cb(err); return; } - token.reason = new CanceledError(message); - resolvePromise(token.reason); - }); -} + values.forEach(function(length) { + knownLength += length; + }); -/** - * Throws a `CanceledError` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } + cb(null, knownLength); + }); }; -/** - * Subscribe to the cancel signal - */ +FormData.prototype.submit = function(params, cb) { + var request + , options + , defaults = {method: 'post'} + ; -CancelToken.prototype.subscribe = function subscribe(listener) { - if (this.reason) { - listener(this.reason); - return; - } + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { - if (this._listeners) { - this._listeners.push(listener); + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + + // use custom params } else { - this._listeners = [listener]; + + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; + } } -}; -/** - * Unsubscribe from the cancel signal - */ + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); -CancelToken.prototype.unsubscribe = function unsubscribe(listener) { - if (!this._listeners) { - return; - } - var index = this._listeners.indexOf(listener); - if (index !== -1) { - this._listeners.splice(index, 1); + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https.request(options); + } else { + request = http.request(options); } -}; - -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; -module.exports = CancelToken; + // get content length and fire away + this.getLength(function(err, length) { + if (err && err !== 'Unknown stream') { + this._error(err); + return; + } + // add content length + if (length) { + request.setHeader('Content-Length', length); + } -/***/ }), + this.pipe(request); + if (cb) { + var onResponse; -/***/ 34098: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var callback = function (error, responce) { + request.removeListener('error', callback); + request.removeListener('response', onResponse); -"use strict"; + return cb.call(this, error, responce); + }; + onResponse = callback.bind(this, null); -var AxiosError = __nccwpck_require__(72093); -var utils = __nccwpck_require__(20328); + request.on('error', callback); + request.on('response', onResponse); + } + }.bind(this)); -/** - * A `CanceledError` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function CanceledError(message) { - // eslint-disable-next-line no-eq-null,eqeqeq - AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED); - this.name = 'CanceledError'; -} + return request; +}; -utils.inherits(CanceledError, AxiosError, { - __CANCEL__: true -}); +FormData.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; -module.exports = CanceledError; +FormData.prototype.toString = function () { + return '[object FormData]'; +}; /***/ }), -/***/ 64057: +/***/ 17142: /***/ ((module) => { -"use strict"; +// populates missing values +module.exports = function(dst, src) { + Object.keys(src).forEach(function(prop) + { + dst[prop] = dst[prop] || src[prop]; + }); -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); + return dst; }; /***/ }), -/***/ 98178: +/***/ 46863: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch +var fs = __nccwpck_require__(57147) +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync -var utils = __nccwpck_require__(20328); -var buildURL = __nccwpck_require__(30646); -var InterceptorManager = __nccwpck_require__(3214); -var dispatchRequest = __nccwpck_require__(85062); -var mergeConfig = __nccwpck_require__(74831); -var buildFullPath = __nccwpck_require__(41934); -var validator = __nccwpck_require__(51632); +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = __nccwpck_require__(71734) -var validators = validator.validators; -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) } -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(configOrUrl, config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof configOrUrl === 'string') { - config = config || {}; - config.url = configOrUrl; - } else { - config = configOrUrl || {}; +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) } - config = mergeConfig(this.defaults, config); + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) } - var transitional = config.transitional; + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean), - forcedJSONParsing: validators.transitional(validators.boolean), - clarifyTimeoutError: validators.transitional(validators.boolean) - }, false); +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} + + +/***/ }), + +/***/ 71734: +/***/ ((__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. + +var pathModule = __nccwpck_require__(71017); +var isWindows = process.platform === 'win32'; +var fs = __nccwpck_require__(57147); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } } - // filter out skipped interceptors - var requestInterceptorChain = []; - var synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } } + } +} - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); + var original = p, + seenLinks = {}, + knownHard = {}; - var promise; + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest, undefined]; + start(); - Array.prototype.unshift.apply(chain, requestInterceptorChain); - chain = chain.concat(responseInterceptorChain); + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; - promise = Promise.resolve(config); - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; } - - return promise; } + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; - var newConfig = config; - while (requestInterceptorChain.length) { - var onFulfilled = requestInterceptorChain.shift(); - var onRejected = requestInterceptorChain.shift(); - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected(error); - break; + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; } - } - try { - promise = dispatchRequest(newConfig); - } catch (error) { - return Promise.reject(error); - } + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } - while (responseInterceptorChain.length) { - promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); } - return promise; -}; + if (cache) cache[original] = p; -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - var fullPath = buildFullPath(config.baseURL, config.url); - return buildURL(fullPath, config.params, config.paramsSerializer); + return p; }; -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - function generateHTTPMethod(isForm) { - return function httpMethod(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - headers: isForm ? { - 'Content-Type': 'multipart/form-data' - } : {}, - url: url, - data: data - })); - }; +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; } - Axios.prototype[method] = generateHTTPMethod(); - - Axios.prototype[method + 'Form'] = generateHTTPMethod(true); -}); + // make p is absolute + p = pathModule.resolve(p); -module.exports = Axios; + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + var original = p, + seenLinks = {}, + knownHard = {}; -/***/ }), + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; -/***/ 72093: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + start(); -"use strict"; + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } -var utils = __nccwpck_require__(20328); + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -function AxiosError(message, code, config, request, response) { - Error.call(this); - this.message = message; - this.name = 'AxiosError'; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - response && (this.response = response); -} + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; -utils.inherits(AxiosError, Error, { - toJSON: function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code, - status: this.response && this.response.status ? this.response.status : null - }; - } -}); + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } -var prototype = AxiosError.prototype; -var descriptors = {}; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } -[ - 'ERR_BAD_OPTION_VALUE', - 'ERR_BAD_OPTION', - 'ECONNABORTED', - 'ETIMEDOUT', - 'ERR_NETWORK', - 'ERR_FR_TOO_MANY_REDIRECTS', - 'ERR_DEPRECATED', - 'ERR_BAD_RESPONSE', - 'ERR_BAD_REQUEST', - 'ERR_CANCELED' -// eslint-disable-next-line func-names -].forEach(function(code) { - descriptors[code] = {value: code}; -}); + return fs.lstat(base, gotStat); + } -Object.defineProperties(AxiosError, descriptors); -Object.defineProperty(prototype, 'isAxiosError', {value: true}); + function gotStat(err, stat) { + if (err) return cb(err); -// eslint-disable-next-line func-names -AxiosError.from = function(error, code, config, request, response, customProps) { - var axiosError = Object.create(prototype); + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } - utils.toFlatObject(error, axiosError, function filter(obj) { - return obj !== Error.prototype; - }); + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); - AxiosError.call(axiosError, error.message, code, config, request, response); + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } - axiosError.name = error.name; + function gotTarget(err, target, base) { + if (err) return cb(err); - customProps && Object.assign(axiosError, customProps); + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } - return axiosError; + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } }; -module.exports = AxiosError; - /***/ }), -/***/ 3214: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 47625: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} -var utils = __nccwpck_require__(20328); +var fs = __nccwpck_require__(57147) +var path = __nccwpck_require__(71017) +var minimatch = __nccwpck_require__(36453) +var isAbsolute = (__nccwpck_require__(71017).isAbsolute) +var Minimatch = minimatch.Minimatch -function InterceptorManager() { - this.handlers = []; +function alphasort (a, b) { + return a.localeCompare(b, 'en') } -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; -}; +function setupIgnores (self, options) { + self.ignore = options.ignore || [] -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) } -}; +} -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); -}; +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } -module.exports = InterceptorManager; + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + self.fs = options.fs || fs + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = path.resolve(cwd) + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) -/***/ }), + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + self.nomount = !!options.nomount -/***/ 41934: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (process.platform === "win32") { + self.root = self.root.replace(/\\/g, "/") + self.cwd = self.cwd.replace(/\\/g, "/") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + } -"use strict"; + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + // always treat \ in patterns as escapes, not path separators + options.allowWindowsEscape = true + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} -var isAbsoluteURL = __nccwpck_require__(41301); -var combineURLs = __nccwpck_require__(57189); +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } } - return requestedURL; -}; + if (!nou) + all = Object.keys(all) -/***/ }), + if (!self.nosort) + all = all.sort(alphasort) -/***/ 85062: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } -"use strict"; + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + self.found = all +} -var utils = __nccwpck_require__(20328); -var transformData = __nccwpck_require__(19812); -var isCancel = __nccwpck_require__(64057); -var defaults = __nccwpck_require__(21626); -var CanceledError = __nccwpck_require__(34098); +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' -/** - * Throws a `CanceledError` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) - if (config.signal && config.signal.aborted) { - throw new CanceledError(); + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - // Transform request data - config.data = transformData.call( - config, - config.data, - config.headers, - config.transformRequest - ); + return m +} - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; - } - ); + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') - var adapter = config.adapter || defaults.adapter; + return abs +} - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - // Transform response data - response.data = transformData.call( - config, - response.data, - response.headers, - config.transformResponse - ); +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } - } +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false - return Promise.reject(reason); - }); -}; + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} /***/ }), -/***/ 74831: +/***/ 91957: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. +module.exports = glob -var utils = __nccwpck_require__(20328); +var rp = __nccwpck_require__(46863) +var minimatch = __nccwpck_require__(36453) +var Minimatch = minimatch.Minimatch +var inherits = __nccwpck_require__(44124) +var EE = (__nccwpck_require__(82361).EventEmitter) +var path = __nccwpck_require__(71017) +var assert = __nccwpck_require__(39491) +var isAbsolute = (__nccwpck_require__(71017).isAbsolute) +var globSync = __nccwpck_require__(29010) +var common = __nccwpck_require__(47625) +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = __nccwpck_require__(52492) +var util = __nccwpck_require__(73837) +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; +var once = __nccwpck_require__(1223) - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} - // eslint-disable-next-line consistent-return - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - return getMergedValue(undefined, config1[prop]); - } + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) } - // eslint-disable-next-line consistent-return - function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(undefined, config2[prop]); - } - } + return new Glob(pattern, options, cb) +} - // eslint-disable-next-line consistent-return - function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - return getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - return getMergedValue(undefined, config1[prop]); - } +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin } - // eslint-disable-next-line consistent-return - function mergeDirectKeys(prop) { - if (prop in config2) { - return getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - return getMergedValue(undefined, config1[prop]); - } + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] } + return origin +} - var mergeMap = { - 'url': valueFromConfig2, - 'method': valueFromConfig2, - 'data': valueFromConfig2, - 'baseURL': defaultToConfig2, - 'transformRequest': defaultToConfig2, - 'transformResponse': defaultToConfig2, - 'paramsSerializer': defaultToConfig2, - 'timeout': defaultToConfig2, - 'timeoutMessage': defaultToConfig2, - 'withCredentials': defaultToConfig2, - 'adapter': defaultToConfig2, - 'responseType': defaultToConfig2, - 'xsrfCookieName': defaultToConfig2, - 'xsrfHeaderName': defaultToConfig2, - 'onUploadProgress': defaultToConfig2, - 'onDownloadProgress': defaultToConfig2, - 'decompress': defaultToConfig2, - 'maxContentLength': defaultToConfig2, - 'maxBodyLength': defaultToConfig2, - 'beforeRedirect': defaultToConfig2, - 'transport': defaultToConfig2, - 'httpAgent': defaultToConfig2, - 'httpsAgent': defaultToConfig2, - 'cancelToken': defaultToConfig2, - 'socketPath': defaultToConfig2, - 'responseEncoding': defaultToConfig2, - 'validateStatus': mergeDirectKeys - }; +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true - utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { - var merge = mergeMap[prop] || mergeDeepProperties; - var configValue = merge(prop); - (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); - }); + var g = new Glob(pattern, options) + var set = g.minimatch.set - return config; -}; + if (!pattern) + return false + + if (set.length > 1) + return true + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } -/***/ }), + return false +} -/***/ 13211: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } -"use strict"; + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) -var AxiosError = __nccwpck_require__(72093); + setopts(this, pattern, options) + this._didRealPath = false -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(new AxiosError( - 'Request failed with status code ' + response.status, - [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], - response.config, - response.request, - response - )); - } -}; + // process each pattern in the minimatch set + var n = this.minimatch.set.length + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) -/***/ }), + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } -/***/ 19812: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var self = this + this._processing = 0 -"use strict"; + this._emitQueue = [] + this._processQueue = [] + this.paused = false + if (this.noprocess) + return this -var utils = __nccwpck_require__(20328); -var defaults = __nccwpck_require__(21626); + if (n === 0) + return done() -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - var context = this || defaults; - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn.call(context, data, headers); - }); + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} - return data; -}; +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + if (this.realpath && !this._didRealpath) + return this._realpath() -/***/ }), + common.finish(this) + this.emit('end', this.found) +} -/***/ 17024: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +Glob.prototype._realpath = function () { + if (this._didRealpath) + return -// eslint-disable-next-line strict -module.exports = __nccwpck_require__(64334); + this._didRealpath = true + var n = this.matches.length + if (n === 0) + return this._finish() -/***/ }), + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) -/***/ 21626: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + function next () { + if (--n === 0) + self._finish() + } +} -"use strict"; +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} -var utils = __nccwpck_require__(20328); -var normalizeHeaderName = __nccwpck_require__(36240); -var AxiosError = __nccwpck_require__(72093); -var transitionalDefaults = __nccwpck_require__(40936); -var toFormData = __nccwpck_require__(20470); +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') } -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __nccwpck_require__(3454); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = __nccwpck_require__(68104); +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') } - return adapter; } -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) } } } - - return (encoder || JSON.stringify)(rawValue); } -var defaults = { +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') - transitional: transitionalDefaults, + if (this.aborted) + return - adapter: getDefaultAdapter(), + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); + //console.error('PROCESS %d', this._processing, pattern) - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. - var isObjectPayload = utils.isObject(data); - var contentType = headers && headers['Content-Type']; + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return - var isFileList; + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break - if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) { - var _FormData = this.env && this.env.FormData; - return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData()); - } else if (isObjectPayload || contentType === 'application/json') { - setContentTypeIfUnset(headers, 'application/json'); - return stringifySafely(data); - } + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } - return data; - }], + var remain = pattern.slice(n) - transformResponse: [function transformResponse(data) { - var transitional = this.transitional || defaults.transitional; - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix - if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - } - throw e; - } - } - } + var abs = this._makeAbs(read) - return data; - }], + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} - maxContentLength: -1, - maxBodyLength: -1, +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - env: { - FormData: __nccwpck_require__(17024) - }, + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - }, + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' - headers: { - common: { - 'Accept': 'application/json, text/plain, */*' + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) } } -}; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) -module.exports = defaults; + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. -/***/ }), + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) -/***/ 40936: -/***/ ((module) => { + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } -"use strict"; + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} -module.exports = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false -}; +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + if (isIgnored(this, e)) + return -/***/ }), + if (this.paused) { + this._emitQueue.push([index, e]) + return + } -/***/ 94322: -/***/ ((module) => { + var abs = isAbsolute(e) ? e : this._makeAbs(e) -module.exports = { - "version": "0.27.2" -}; + if (this.mark) + e = this._mark(e) -/***/ }), + if (this.absolute) + e = abs -/***/ 77065: -/***/ ((module) => { + if (this.matches[index][e]) + return -"use strict"; + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + this.matches[index][e] = true -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + this.emit('match', e) +} -/***/ }), +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return -/***/ 30646: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) -"use strict"; + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + if (lstatcb) + self.fs.lstat(abs, lstatcb) -var utils = __nccwpck_require__(20328); + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() -function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) } +} - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; - } + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; - } + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() - serializedParams = parts.join('&'); + if (Array.isArray(c)) + return cb(null, c) } - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } + var self = this + self.fs.readdir(abs, readdirCb(this, abs, cb)) +} - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) } +} - return url; -}; - - -/***/ }), - -/***/ 57189: -/***/ ((module) => { +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return -"use strict"; + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + this.cache[abs] = entries + return cb(null, entries) +} -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break -/***/ }), + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break -/***/ 21545: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } -"use strict"; + return cb() +} +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} -var utils = __nccwpck_require__(20328); -module.exports = ( - utils.isStandardBrowserEnv() ? +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) - if (utils.isString(path)) { - cookie.push('path=' + path); - } + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } + var isSym = this.symlinks[abs] + var len = entries.length - if (secure === true) { - cookie.push('secure'); - } + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() - document.cookie = cookie.join('; '); - }, + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); - } - }; - })() : + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() -); + cb() +} +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { -/***/ }), + //console.error('ps2', prefix, exists) -/***/ 41301: -/***/ ((module) => { + if (!this.matches[index]) + this.matches[index] = Object.create(null) -"use strict"; + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -}; + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} -/***/ }), +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' -/***/ 60650: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (f.length > this.maxLength) + return cb() -"use strict"; + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (Array.isArray(c)) + c = 'DIR' -var utils = __nccwpck_require__(20328); + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -module.exports = function isAxiosError(payload) { - return utils.isObject(payload) && (payload.isAxiosError === true); -}; + if (needDir && c === 'FILE') + return cb() + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } -/***/ }), + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } -/***/ 33608: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + self.fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} -"use strict"; +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat -var utils = __nccwpck_require__(20328); + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) -module.exports = ( - utils.isStandardBrowserEnv() ? + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; + if (needDir && c === 'FILE') + return cb() - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; + return cb(null, c, stat) +} - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - urlParsingNode.setAttribute('href', href); +/***/ }), - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } +/***/ 51046: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - originURL = resolveURL(window.location.href); +var balanced = __nccwpck_require__(9417); - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : +module.exports = expandTop; - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })() -); +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} -/***/ }), +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} -/***/ 36240: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} -"use strict"; +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; -var utils = __nccwpck_require__(20328); + var parts = []; + var m = balanced('{', '}', str); -module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; - } - }); -}; + if (!m) + return str.split(','); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); -/***/ }), + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } -/***/ 86455: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + parts.push.apply(parts, p); -"use strict"; + return parts; +} +function expandTop(str) { + if (!str) + return []; -var utils = __nccwpck_require__(20328); + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; + return expand(escapeBraces(str), true).map(unescapeBraces); +} -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} - if (!headers) { return parsed; } +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); +function expand(str, isTop) { + var expansions = []; - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + var m = balanced('{', '}', str); + if (!m) return [str]; + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } } - }); - return parsed; -}; + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); -/***/ }), + N = []; -/***/ 66107: -/***/ ((module) => { + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; -"use strict"; + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand(n[j], false)); + } + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + } + return expansions; +} -module.exports = function parseProtocol(url) { - var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); - return match && match[1] || ''; -}; /***/ }), -/***/ 74850: +/***/ 73438: /***/ ((module) => { -"use strict"; - - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; +const isWindows = typeof process === 'object' && + process && + process.platform === 'win32' +module.exports = isWindows ? { sep: '\\' } : { sep: '/' } /***/ }), -/***/ 20470: +/***/ 36453: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +const minimatch = module.exports = (p, pattern, options = {}) => { + assertValidPattern(pattern) + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } -var utils = __nccwpck_require__(20328); + return new Minimatch(pattern, options).match(p) +} -/** - * Convert a data object to FormData - * @param {Object} obj - * @param {?Object} [formData] - * @returns {Object} - **/ +module.exports = minimatch -function toFormData(obj, formData) { - // eslint-disable-next-line no-param-reassign - formData = formData || new FormData(); +const path = __nccwpck_require__(73438) +minimatch.sep = path.sep - var stack = []; +const GLOBSTAR = Symbol('globstar **') +minimatch.GLOBSTAR = GLOBSTAR +const expand = __nccwpck_require__(51046) - function convertValue(value) { - if (value === null) return ''; +const plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} - if (utils.isDate(value)) { - return value.toISOString(); - } +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]' - if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { - return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); - } +// * => any number of characters +const star = qmark + '*?' - return value; - } +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - function build(data, parentKey) { - if (utils.isPlainObject(data) || utils.isArray(data)) { - if (stack.indexOf(data) !== -1) { - throw Error('Circular reference detected in ' + parentKey); - } +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - stack.push(data); +// "abc" -> { a:true, b:true, c:true } +const charSet = s => s.split('').reduce((set, c) => { + set[c] = true + return set +}, {}) - utils.forEach(data, function each(value, key) { - if (utils.isUndefined(value)) return; - var fullKey = parentKey ? parentKey + '.' + key : key; - var arr; +// characters that need to be escaped in RegExp. +const reSpecials = charSet('().*{}+?[]^$\\!') - if (value && !parentKey && typeof value === 'object') { - if (utils.endsWith(key, '{}')) { - // eslint-disable-next-line no-param-reassign - value = JSON.stringify(value); - } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) { - // eslint-disable-next-line func-names - arr.forEach(function(el) { - !utils.isUndefined(el) && formData.append(fullKey, convertValue(el)); - }); - return; - } - } +// characters that indicate we have to add the pattern start +const addPatternStartSet = charSet('[.(') - build(value, fullKey); - }); +// normalizes slashes. +const slashSplit = /\/+/ - stack.pop(); - } else { - formData.append(parentKey, convertValue(data)); - } +minimatch.filter = (pattern, options = {}) => + (p, i, list) => minimatch(p, pattern, options) + +const ext = (a, b = {}) => { + const t = {} + Object.keys(a).forEach(k => t[k] = a[k]) + Object.keys(b).forEach(k => t[k] = b[k]) + return t +} + +minimatch.defaults = def => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch } - build(obj); + const orig = minimatch - return formData; + const m = (p, pattern, options) => orig(p, pattern, ext(def, options)) + m.Minimatch = class Minimatch extends orig.Minimatch { + constructor (pattern, options) { + super(pattern, ext(def, options)) + } + } + m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch + m.filter = (pattern, options) => orig.filter(pattern, ext(def, options)) + m.defaults = options => orig.defaults(ext(def, options)) + m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options)) + m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options)) + m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options)) + + return m } -module.exports = toFormData; -/***/ }), -/***/ 51632: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options) +const braceExpand = (pattern, options = {}) => { + assertValidPattern(pattern) -var VERSION = (__nccwpck_require__(94322).version); -var AxiosError = __nccwpck_require__(72093); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } -var validators = {}; + return expand(pattern) +} -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); +const MAX_PATTERN_LENGTH = 1024 * 64 +const assertValidPattern = pattern => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } -var deprecatedWarnings = {}; + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} -/** - * Transitional option validator - * @param {function|boolean?} validator - set to false if the transitional option has been removed - * @param {string?} version - deprecated version / removed since version - * @param {string?} message - some message with additional info - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - function formatMessage(opt, desc) { - return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const SUBPARSE = Symbol('subparse') + +minimatch.makeRe = (pattern, options) => + new Minimatch(pattern, options || {}).makeRe() + +minimatch.match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options) + list = list.filter(f => mm.match(f)) + if (mm.options.nonull && !list.length) { + list.push(pattern) } + return list +} - // eslint-disable-next-line func-names - return function(value, opt, opts) { - if (validator === false) { - throw new AxiosError( - formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), - AxiosError.ERR_DEPRECATED - ); - } +// replace stuff like \* with * +const globUnescape = s => s.replace(/\\(.)/g, '$1') +const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') - if (version && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } +class Minimatch { + constructor (pattern, options) { + assertValidPattern(pattern) - return validator ? validator(value, opt, opts) : true; - }; -}; + if (!options) options = {} -/** - * Assert object's properties type - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - */ + this.options = options + this.set = [] + this.pattern = pattern + this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || + options.allowWindowsEscape === false + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/') + } + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { - throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + // make the set of regexps etc. + this.make() } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - var validator = schema[opt]; - if (validator) { - var value = options[opt]; - var result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); - } - continue; + + debug () {} + + make () { + const pattern = this.pattern + const options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return } - if (allowUnknown !== true) { - throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + if (!pattern) { + this.empty = true + return } - } -} - -module.exports = { - assertOptions: assertOptions, - validators: validators -}; + // step 1: figure out negation, etc. + this.parseNegate() -/***/ }), + // step 2: expand braces + let set = this.globSet = this.braceExpand() -/***/ 20328: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + if (options.debug) this.debug = (...args) => console.error(...args) -"use strict"; + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(s => s.split(slashSplit)) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map((s, si, set) => s.map(this.parse, this)) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(s => s.indexOf(false) === -1) + + this.debug(this.pattern, set) + + this.set = set + } + + parseNegate () { + if (this.options.nonegate) return + + const pattern = this.pattern + let negate = false + let negateOffset = 0 + + for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate + } + + // set partial to true to test if, for example, + // "/a/b" matches the start of "/*/b/*/d" + // Partial means, if you run out of file before you run + // out of pattern, then that's fine, as long as all + // the parts match. + matchOne (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] -var bind = __nccwpck_require__(77065); + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) -// utils is a library of generic helper functions non-specific to axios + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } -var toString = Object.prototype.toString; + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } -// eslint-disable-next-line func-names -var kindOf = (function(cache) { - // eslint-disable-next-line func-names - return function(thing) { - var str = toString.call(thing); - return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); - }; -})(Object.create(null)); + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } -function kindOfTest(type) { - type = type.toLowerCase(); - return function isKindOf(thing) { - return kindOf(thing) === type; - }; -} + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ -function isArray(val) { - return Array.isArray(val); -} + if (!hit) return false + } -/** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ -function isUndefined(val) { - return typeof val === 'undefined'; -} + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* -/** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); -} + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') + } + + braceExpand () { + return braceExpand(this.pattern, this.options) + } + + parse (pattern, isSub) { + assertValidPattern(pattern) + + const options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + let re = '' + let hasMagic = !!options.nocase + let escaping = false + // ? => one single character + const patternListStack = [] + const negativeLists = [] + let stateChar + let inClass = false + let reClassStart = -1 + let classStart = -1 + let cs + let pl + let sp + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + const patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + + const clearStateChar = () => { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + this.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } -/** - * Determine if a value is an ArrayBuffer - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -var isArrayBuffer = kindOfTest('ArrayBuffer'); + for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + // skip over any that are escaped. + if (escaping) { + /* istanbul ignore next - completely not allowed, even escaped. */ + if (c === '/') { + return false + } -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); - } - return result; -} + if (reSpecials[c]) { + re += '\\' + } + re += c + escaping = false + continue + } -/** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ -function isString(val) { - return typeof val === 'string'; -} + switch (c) { + /* istanbul ignore next */ + case '/': { + // Should already be path-split by now. + return false + } -/** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ -function isNumber(val) { - return typeof val === 'number'; -} + case '\\': + clearStateChar() + escaping = true + continue -/** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ -function isObject(val) { - return val !== null && typeof val === 'object'; -} + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } -/** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ -function isPlainObject(val) { - if (kindOf(val) !== 'object') { - return false; - } + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + this.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; -} + case '(': + if (inClass) { + re += '(' + continue + } -/** - * Determine if a value is a Date - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ -var isDate = kindOfTest('Date'); + if (!stateChar) { + re += '\\(' + continue + } -/** - * Determine if a value is a File - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -var isFile = kindOfTest('File'); + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue -/** - * Determine if a value is a Blob - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ -var isBlob = kindOfTest('Blob'); + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } -/** - * Determine if a value is a FileList - * - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -var isFileList = kindOfTest('FileList'); + clearStateChar() + hasMagic = true + pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue -/** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -function isFunction(val) { - return toString.call(val) === '[object Function]'; -} + case '|': + if (inClass || !patternListStack.length) { + re += '\\|' + continue + } -/** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ -function isStream(val) { - return isObject(val) && isFunction(val.pipe); -} + clearStateChar() + re += '|' + continue -/** - * Determine if a value is a FormData - * - * @param {Object} thing The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ -function isFormData(thing) { - var pattern = '[object FormData]'; - return thing && ( - (typeof FormData === 'function' && thing instanceof FormData) || - toString.call(thing) === pattern || - (isFunction(thing.toString) && thing.toString() === pattern) - ); -} + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() -/** - * Determine if a value is a URLSearchParams object - * @function - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -var isURLSearchParams = kindOfTest('URLSearchParams'); + if (inClass) { + re += '\\' + c + continue + } -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ -function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); -} + inClass = true + classStart = i + reClassStart = re.length + re += c + continue -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + continue + } -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } + // finish up the class. + hasMagic = true + inClass = false + re += c + continue - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (reSpecials[c] && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + break + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + let tail + tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { + /* istanbul ignore else - should already be done */ + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + const t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + const addPatternStart = addPatternStartSet[re.charAt(0)] + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (let n = negativeLists.length - 1; n > -1; n--) { + const nl = negativeLists[n] + + const nlBefore = re.slice(0, nl.reStart) + const nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + let nlAfter = re.slice(nl.reEnd) + const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + const openParensBefore = nlBefore.split('(').length - 1 + let cleanAfter = nlAfter + for (let i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') } + nlAfter = cleanAfter + + const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : '' + re = nlBefore + nlFirst + nlAfter + dollar + nlLast } - } -} -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re } - } - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} + if (addPatternStart) { + re = patternStart + re + } -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] } - }); - return a; -} -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ -function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + const flags = options.nocase ? 'i' : '' + try { + return Object.assign(new RegExp('^' + re + '$', flags), { + _glob: pattern, + _src: re, + }) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } } - return content; -} -/** - * Inherit the prototype methods from one constructor into another - * @param {function} constructor - * @param {function} superConstructor - * @param {object} [props] - * @param {object} [descriptors] - */ + makeRe () { + if (this.regexp || this.regexp === false) return this.regexp -function inherits(constructor, superConstructor, props, descriptors) { - constructor.prototype = Object.create(superConstructor.prototype, descriptors); - constructor.prototype.constructor = constructor; - props && Object.assign(constructor.prototype, props); -} + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + const set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + const options = this.options + + const twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + const flags = options.nocase ? 'i' : '' + + // coalesce globstars and regexpify non-globstar patterns + // if it's the only item, then we just do one twoStar + // if it's the first, and there are more, prepend (\/|twoStar\/)? to next + // if it's the last, append (\/twoStar|) to previous + // if it's in the middle, append (\/|\/twoStar\/) to previous + // then filter out GLOBSTAR symbols + let re = set.map(pattern => { + pattern = pattern.map(p => + typeof p === 'string' ? regExpEscape(p) + : p === GLOBSTAR ? GLOBSTAR + : p._src + ).reduce((set, p) => { + if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) { + set.push(p) + } + return set + }, []) + pattern.forEach((p, i) => { + if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) { + return + } + if (i === 0) { + if (pattern.length > 1) { + pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1] + } else { + pattern[i] = twoStar + } + } else if (i === pattern.length - 1) { + pattern[i-1] += '(?:\\\/|' + twoStar + ')?' + } else { + pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1] + pattern[i+1] = GLOBSTAR + } + }) + return pattern.filter(p => p !== GLOBSTAR).join('/') + }).join('|') -/** - * Resolve object with deep prototype chain to a flat object - * @param {Object} sourceObj source object - * @param {Object} [destObj] - * @param {Function} [filter] - * @returns {Object} - */ + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' -function toFlatObject(sourceObj, destObj, filter) { - var props; - var i; - var prop; - var merged = {}; + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' - destObj = destObj || {}; + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp + } - do { - props = Object.getOwnPropertyNames(sourceObj); - i = props.length; - while (i-- > 0) { - prop = props[i]; - if (!merged[prop]) { - destObj[prop] = sourceObj[prop]; - merged[prop] = true; - } + match (f, partial = this.partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + const options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') } - sourceObj = Object.getPrototypeOf(sourceObj); - } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); - return destObj; -} + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) -/* - * determines whether a string ends with the characters of a specified string - * @param {String} str - * @param {String} searchString - * @param {Number} [position= 0] - * @returns {boolean} - */ -function endsWith(str, searchString, position) { - str = String(str); - if (position === undefined || position > str.length) { - position = str.length; - } - position -= searchString.length; - var lastIndex = str.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; -} + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + const set = this.set + this.debug(this.pattern, 'set', set) -/** - * Returns new array from array like object - * @param {*} [thing] - * @returns {Array} - */ -function toArray(thing) { - if (!thing) return null; - var i = thing.length; - if (isUndefined(i)) return null; - var arr = new Array(i); - while (i-- > 0) { - arr[i] = thing[i]; + // Find the basename of the path by looking for the last non-empty segment + let filename + for (let i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (let i = 0; i < set.length; i++) { + const pattern = set[i] + let file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + const hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate } - return arr; -} -// eslint-disable-next-line func-names -var isTypedArray = (function(TypedArray) { - // eslint-disable-next-line func-names - return function(thing) { - return TypedArray && thing instanceof TypedArray; - }; -})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array)); + static defaults (def) { + return minimatch.defaults(def).Minimatch + } +} -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM, - inherits: inherits, - toFlatObject: toFlatObject, - kindOf: kindOf, - kindOfTest: kindOfTest, - endsWith: endsWith, - toArray: toArray, - isTypedArray: isTypedArray, - isFileList: isFileList -}; +minimatch.Minimatch = Minimatch /***/ }), -/***/ 83682: +/***/ 29010: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var register = __nccwpck_require__(44670) -var addHook = __nccwpck_require__(5549) -var removeHook = __nccwpck_require__(6819) +module.exports = globSync +globSync.GlobSync = GlobSync -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind -var bindable = bind.bind(bind) +var rp = __nccwpck_require__(46863) +var minimatch = __nccwpck_require__(36453) +var Minimatch = minimatch.Minimatch +var Glob = (__nccwpck_require__(91957).Glob) +var util = __nccwpck_require__(73837) +var path = __nccwpck_require__(71017) +var assert = __nccwpck_require__(39491) +var isAbsolute = (__nccwpck_require__(71017).isAbsolute) +var common = __nccwpck_require__(47625) +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored -function bindApi (hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) - hook.api = { remove: removeHookRef } - hook.remove = removeHookRef +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') - ;['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) - }) + return new GlobSync(pattern, options).found } -function HookSingular () { - var singularHookName = 'h' - var singularHookState = { - registry: {} +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) } - var singularHook = register.bind(null, singularHookState, singularHookName) - bindApi(singularHook, singularHookState, singularHookName) - return singularHook + this._finish() } -function HookCollection () { - var state = { - registry: {} +GlobSync.prototype._finish = function () { + assert.ok(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) } + common.finish(this) +} - var hook = register.bind(null, state) - bindApi(hook, state) - return hook -} +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert.ok(this instanceof GlobSync) -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 + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ } - return HookCollection() + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } -Hook.Singular = HookSingular.bind() -Hook.Collection = HookCollection.bind() -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 +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + // if the abs isn't a dir, then nothing can match! + if (!entries) + return -/***/ }), + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } -/***/ 5549: -/***/ ((module) => { + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return -module.exports = addHook; + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return } - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); - }; + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) } +} - 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; - }); - }; + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs } - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return } - state.registry[name].push({ - hook: hook, - orig: orig, - }); + this.matches[index][e] = true + + if (this.stat) + this._stat(e) } -/***/ }), +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) -/***/ 44670: -/***/ ((module) => { + var entries + var lstat + var stat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } -module.exports = register; + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) - if (!options) { - options = {}; + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c } - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null } +} - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true } + } - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); - }); + this.cache[abs] = entries + + // mark and cache dir-ness + return entries } +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break -/***/ }), + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break -/***/ 6819: -/***/ ((module) => { + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} -module.exports = removeHook; +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } + var entries = this._readdir(abs, inGlobStar) - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return - if (index === -1) { - return; - } + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) - state.registry[name].splice(index, 1); + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } } +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) -/***/ }), + if (!this.matches[index]) + this.matches[index] = Object.create(null) -/***/ 85443: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + // If it doesn't exist, then just mark the lack of results + if (!exists) + return -var util = __nccwpck_require__(73837); -var Stream = (__nccwpck_require__(12781).Stream); -var DelayedStream = __nccwpck_require__(18611); + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } -module.exports = CombinedStream; -function CombinedStream() { - this.writable = false; - this.readable = true; - this.dataSize = 0; - this.maxDataSize = 2 * 1024 * 1024; - this.pauseStreams = true; + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') - this._released = false; - this._streams = []; - this._currentStream = null; - this._insideLoop = false; - this._pendingNext = false; + // Mark this as a match + this._emitMatch(index, prefix) } -util.inherits(CombinedStream, Stream); -CombinedStream.create = function(options) { - var combinedStream = new this(); +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' - options = options || {}; - for (var option in options) { - combinedStream[option] = options[option]; - } + if (f.length > this.maxLength) + return false - return combinedStream; -}; + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] -CombinedStream.isStreamLike = function(stream) { - return (typeof stream !== 'function') - && (typeof stream !== 'string') - && (typeof stream !== 'boolean') - && (typeof stream !== 'number') - && (!Buffer.isBuffer(stream)); -}; + if (Array.isArray(c)) + c = 'DIR' -CombinedStream.prototype.append = function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c - if (isStreamLike) { - if (!(stream instanceof DelayedStream)) { - var newStream = DelayedStream.create(stream, { - maxDataSize: Infinity, - pauseStream: this.pauseStreams, - }); - stream.on('data', this._checkDataSize.bind(this)); - stream = newStream; - } + if (needDir && c === 'FILE') + return false - this._handleErrors(stream); + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } - if (this.pauseStreams) { - stream.pause(); + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat } } - this._streams.push(stream); - return this; -}; + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + + +/***/ }), + +/***/ 31621: +/***/ ((module) => { + +"use strict"; + -CombinedStream.prototype.pipe = function(dest, options) { - Stream.prototype.pipe.call(this, dest, options); - this.resume(); - return dest; +module.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf('--'); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; -CombinedStream.prototype._getNext = function() { - this._currentStream = null; - if (this._insideLoop) { - this._pendingNext = true; - return; // defer call - } +/***/ }), - this._insideLoop = true; - try { - do { - this._pendingNext = false; - this._realGetNext(); - } while (this._pendingNext); - } finally { - this._insideLoop = false; - } -}; +/***/ 52492: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -CombinedStream.prototype._realGetNext = function() { - var stream = this._streams.shift(); +var wrappy = __nccwpck_require__(62940) +var reqs = Object.create(null) +var once = __nccwpck_require__(1223) +module.exports = wrappy(inflight) - if (typeof stream == 'undefined') { - this.end(); - return; +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) } +} - if (typeof stream !== 'function') { - this._pipeNext(stream); - return; - } +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) - var getStream = stream; - getStream(function(stream) { - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('data', this._checkDataSize.bind(this)); - this._handleErrors(stream); + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } } + }) +} - this._pipeNext(stream); - }.bind(this)); -}; +function slice (args) { + var length = args.length + var array = [] -CombinedStream.prototype._pipeNext = function(stream) { - this._currentStream = stream; + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} - var isStreamLike = CombinedStream.isStreamLike(stream); - if (isStreamLike) { - stream.on('end', this._getNext.bind(this)); - stream.pipe(this, {end: false}); - return; - } - var value = stream; - this.write(value); - this._getNext(); -}; +/***/ }), -CombinedStream.prototype._handleErrors = function(stream) { - var self = this; - stream.on('error', function(err) { - self._emitError(err); - }); -}; +/***/ 44124: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -CombinedStream.prototype.write = function(data) { - this.emit('data', data); -}; +try { + var util = __nccwpck_require__(73837); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = __nccwpck_require__(8544); +} -CombinedStream.prototype.pause = function() { - if (!this.pauseStreams) { - return; - } - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); - this.emit('pause'); -}; +/***/ }), -CombinedStream.prototype.resume = function() { - if (!this._released) { - this._released = true; - this.writable = true; - this._getNext(); +/***/ 8544: +/***/ ((module) => { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } } +} - if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); - this.emit('resume'); -}; -CombinedStream.prototype.end = function() { - this._reset(); - this.emit('end'); -}; +/***/ }), -CombinedStream.prototype.destroy = function() { - this._reset(); - this.emit('close'); -}; +/***/ 63287: +/***/ ((__unused_webpack_module, exports) => { -CombinedStream.prototype._reset = function() { - this.writable = false; - this._streams = []; - this._currentStream = null; -}; +"use strict"; -CombinedStream.prototype._checkDataSize = function() { - this._updateDataSize(); - if (this.dataSize <= this.maxDataSize) { - return; - } - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; - this._emitError(new Error(message)); -}; +Object.defineProperty(exports, "__esModule", ({ value: true })); -CombinedStream.prototype._updateDataSize = function() { - this.dataSize = 0; +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ - var self = this; - this._streams.forEach(function(stream) { - if (!stream.dataSize) { - return; - } +function isObject(o) { + return Object.prototype.toString.call(o) === '[object Object]'; +} - self.dataSize += stream.dataSize; - }); +function isPlainObject(o) { + var ctor,prot; - if (this._currentStream && this._currentStream.dataSize) { - this.dataSize += this._currentStream.dataSize; + if (isObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (ctor === undefined) return true; + + // If has modified prototype + prot = ctor.prototype; + if (isObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; } -}; -CombinedStream.prototype._emitError = function(err) { - this._reset(); - this.emit('error', err); -}; + // Most likely a plain Object + return true; +} +exports.isPlainObject = isPlainObject; -/***/ }), -/***/ 28222: -/***/ ((module, exports, __nccwpck_require__) => { +/***/ }), -/* eslint-env browser */ +/***/ 90250: +/***/ (function(module, exports, __nccwpck_require__) { +/* module decorator */ module = __nccwpck_require__.nmd(module); /** - * This is the web browser implementation of `debug()`. + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ +;(function() { -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); + /** Used as the semantic version number. */ + var VERSION = '4.17.21'; -/** - * Colors. - */ + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; -/** - * Colorize log arguments if enabled. - * - * @api public - */ + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; - if (!this.useColors) { - return; - } + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; - args.splice(lastC, 0, c); -} + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } + /** Used to match leading whitespace. */ + var reTrimStart = /^\s+/; - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } + /** Used to match a single whitespace character. */ + var reWhitespace = /\s/; - return r; -} + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} + /** + * Used to validate the `validate` option in `_.template` variable. + * + * Forbids characters which could potentially change the meaning of the function argument definition: + * - "()," (modification of function parameters) + * - "=" (default value) + * - "[]{}" (destructuring of function parameters) + * - "/" (beginning of a comment) + * - whitespace + */ + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; -module.exports = __nccwpck_require__(46243)(exports); + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; -const {formatters} = module.exports; + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; -/***/ }), + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; -/***/ 46243: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = __nccwpck_require__(80900); - createDebug.destroy = destroy; + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - /** - * The currently active debug mode names, and names to skip. - */ + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - createDebug.names = []; - createDebug.skips = []; + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - const self = debug; + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; - args[0] = createDebug.coerce(args[0]); + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - return debug; - } + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } + /** Detect free variable `exports`. */ + var freeExports = true && exports && !exports.nodeType && exports; - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; + /** Detect free variable `module`. */ + var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; - createDebug.names = []; - createDebug.skips = []; + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; - namespaces = split[i].replace(/\*/g, '.*?'); + if (types) { + return types; + } - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - } + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; - let i; - let len; + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } - return false; - } + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } - createDebug.enable(createDebug.load()); + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } - return createDebug; -} + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; -module.exports = setup; + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); -/***/ }), + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } -/***/ 38237: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; -/** - * Detect Electron renderer / nwjs process, which is node, but we should - * treat as a browser. - */ + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } -if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { - module.exports = __nccwpck_require__(28222); -} else { - module.exports = __nccwpck_require__(35332); -} + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } -/***/ }), + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } -/***/ 35332: -/***/ ((module, exports, __nccwpck_require__) => { + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; -/** - * Module dependencies. - */ + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } -const tty = __nccwpck_require__(76224); -const util = __nccwpck_require__(73837); + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); -/** - * This is the Node.js implementation of `debug()`. - */ + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } -exports.init = init; -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.destroy = util.deprecate( - () => {}, - 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' -); + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } -/** - * Colors. - */ + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } -exports.colors = [6, 2, 3, 4, 5, 1]; + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); -try { - // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) - // eslint-disable-next-line import/no-extraneous-dependencies - const supportsColor = __nccwpck_require__(59318); + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } -} catch (error) { - // Swallow - we only care if `supports-color` is available; it doesn't have to be. -} + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } -/** - * Build up the default `inspectOpts` object from the environment variables. - * - * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js - */ + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; -exports.inspectOpts = Object.keys(process.env).filter(key => { - return /^debug_/i.test(key); -}).reduce((obj, key) => { - // Camel-case - const prop = key - .substring(6) - .toLowerCase() - .replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } - // Coerce string value into JS value - let val = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === 'null') { - val = null; - } else { - val = Number(val); - } + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } - obj[prop] = val; - return obj; -}, {}); + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } -/** - * Is stdout a TTY? Colored output is enabled when `true`. - */ + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } -function useColors() { - return 'colors' in exports.inspectOpts ? - Boolean(exports.inspectOpts.colors) : - tty.isatty(process.stderr.fd); -} + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } -/** - * Adds ANSI color escape codes if enabled. - * - * @api public - */ + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } -function formatArgs(args) { - const {namespace: name, useColors} = this; + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; - if (useColors) { - const c = this.color; - const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); - const prefix = ` ${colorCode};1m${name} \u001B[0m`; + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } - args[0] = prefix + args[0].split('\n').join('\n' + prefix); - args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); - } else { - args[0] = getDate() + name + ' ' + args[0]; - } -} + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; -function getDate() { - if (exports.inspectOpts.hideDate) { - return ''; - } - return new Date().toISOString() + ' '; -} + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } -/** - * Invokes `util.format()` with the specified arguments and writes to stderr. - */ + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); -function log(...args) { - return process.stderr.write(util.format(...args) + '\n'); -} + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - // If you set a process.env field to null or undefined, it gets cast to the - // string 'null' or 'undefined'. Just delete instead. - delete process.env.DEBUG; - } -} + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ + /** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ + function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; + } -function load() { - return process.env.DEBUG; -} + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } -/** - * Init logic for `debug` instances. - * - * Create a new `inspectOpts` object in case `useColors` is set - * differently for a particular `debug` instance. - */ + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } -function init(debug) { - debug.inspectOpts = {}; + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } -} + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; -module.exports = __nccwpck_require__(46243)(exports); + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } -const {formatters} = module.exports; + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; -/** - * Map %o to `util.inspect()`, all on a single line. - */ + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } -formatters.o = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts) - .split('\n') - .map(str => str.trim()) - .join(' '); -}; + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; -/** - * Map %O to `util.inspect()`, allowing multiple lines if needed. - */ + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } -formatters.O = function (v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); -}; + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); -/***/ }), + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } -/***/ 18611: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } -var Stream = (__nccwpck_require__(12781).Stream); -var util = __nccwpck_require__(73837); + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } -module.exports = DelayedStream; -function DelayedStream() { - this.source = null; - this.dataSize = 0; - this.maxDataSize = 1024 * 1024; - this.pauseStream = true; + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } - this._maxDataSizeExceeded = false; - this._released = false; - this._bufferedEvents = []; -} -util.inherits(DelayedStream, Stream); + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; -DelayedStream.create = function(source, options) { - var delayedStream = new this(); + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; - options = options || {}; - for (var option in options) { - delayedStream[option] = options[option]; + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; } - delayedStream.source = source; - - var realEmit = source.emit; - source.emit = function() { - delayedStream._handleEmit(arguments); - return realEmit.apply(source, arguments); - }; + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); - source.on('error', function() {}); - if (delayedStream.pauseStream) { - source.pause(); + set.forEach(function(value) { + result[++index] = value; + }); + return result; } - return delayedStream; -}; + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); -Object.defineProperty(DelayedStream.prototype, 'readable', { - configurable: true, - enumerable: true, - get: function() { - return this.source.readable; + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; } -}); -DelayedStream.prototype.setEncoding = function() { - return this.source.setEncoding.apply(this.source, arguments); -}; + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; -DelayedStream.prototype.resume = function() { - if (!this._released) { - this.release(); + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; } - this.source.resume(); -}; - -DelayedStream.prototype.pause = function() { - this.source.pause(); -}; - -DelayedStream.prototype.release = function() { - this._released = true; - - this._bufferedEvents.forEach(function(args) { - this.emit.apply(this, args); - }.bind(this)); - this._bufferedEvents = []; -}; + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } -DelayedStream.prototype.pipe = function() { - var r = Stream.prototype.pipe.apply(this, arguments); - this.resume(); - return r; -}; + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } -DelayedStream.prototype._handleEmit = function(args) { - if (this._released) { - this.emit.apply(this, args); - return; + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); } - if (args[0] === 'data') { - this.dataSize += args[1].length; - this._checkIfMaxDataSizeExceeded(); + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; } - this._bufferedEvents.push(args); -}; + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); -DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { - if (this._maxDataSizeExceeded) { - return; + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; } - if (this.dataSize <= this.maxDataSize) { - return; + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; } - this._maxDataSizeExceeded = true; - var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' - this.emit('error', new Error(message)); -}; + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + /*--------------------------------------------------------------------------*/ -/***/ }), + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); -/***/ 58932: -/***/ ((__unused_webpack_module, exports) => { + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; -"use strict"; + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; -Object.defineProperty(exports, "__esModule", ({ value: true })); + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; - /* istanbul ignore next */ + /** Used to generate unique IDs. */ + var idCounter = 0; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); - this.name = 'Deprecation'; - } + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; -} + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); -exports.Deprecation = Deprecation; + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); -/***/ }), + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; -/***/ 31133: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); -var debug; + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; -module.exports = function () { - if (!debug) { - try { - /* eslint global-require: off */ - debug = __nccwpck_require__(38237)("follow-redirects"); - } - catch (error) { /* */ } - if (typeof debug !== "function") { - debug = function () { /* */ }; - } - } - debug.apply(null, arguments); -}; + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); -/***/ }), + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; -/***/ 67707: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** Used to lookup unminified function names. */ + var realNames = {}; -var url = __nccwpck_require__(57310); -var URL = url.URL; -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var Writable = (__nccwpck_require__(12781).Writable); -var assert = __nccwpck_require__(39491); -var debug = __nccwpck_require__(31133); + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); -// Create handlers that pass events from native requests -var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; -var eventHandlers = Object.create(null); -events.forEach(function (event) { - eventHandlers[event] = function (arg1, arg2, arg3) { - this._redirectable.emit(event, arg1, arg2, arg3); - }; -}); + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; -// Error types with codes -var RedirectionError = createErrorType( - "ERR_FR_REDIRECTION_FAILURE", - "Redirected request failed" -); -var TooManyRedirectsError = createErrorType( - "ERR_FR_TOO_MANY_REDIRECTS", - "Maximum number of redirects exceeded" -); -var MaxBodyLengthExceededError = createErrorType( - "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", - "Request body larger than maxBodyLength limit" -); -var WriteAfterEndError = createErrorType( - "ERR_STREAM_WRITE_AFTER_END", - "write after end" -); + /*------------------------------------------------------------------------*/ -// An HTTP(S) request that can be redirected -function RedirectableRequest(options, responseCallback) { - // Initialize the request - Writable.call(this); - this._sanitizeOptions(options); - this._options = options; - this._ended = false; - this._ending = false; - this._redirectCount = 0; - this._redirects = []; - this._requestBodyLength = 0; - this._requestBodyBuffers = []; + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } - // Attach a callback if passed - if (responseCallback) { - this.on("response", responseCallback); - } + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); - // React to responses of native requests - var self = this; - this._onNativeResponse = function (response) { - self._processResponse(response); - }; + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } - // Perform the first request - this._performRequest(); -} -RedirectableRequest.prototype = Object.create(Writable.prototype); + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } -RedirectableRequest.prototype.abort = function () { - abortRequest(this._currentRequest); - this.emit("abort"); -}; + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { -// Writes buffered data to the current native request -RedirectableRequest.prototype.write = function (data, encoding, callback) { - // Writing is not allowed if end has been called - if (this._ending) { - throw new WriteAfterEndError(); - } + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, - // Validate input and shift parameters if necessary - if (!(typeof data === "string" || typeof data === "object" && ("length" in data))) { - throw new TypeError("data should be a string, Buffer or Uint8Array"); - } - if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, - // Ignore empty buffers, since writing them doesn't invoke the callback - // https://github.com/nodejs/node/issues/22066 - if (data.length === 0) { - if (callback) { - callback(); - } - return; - } - // Only write when we don't exceed the maximum body length - if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { - this._requestBodyLength += data.length; - this._requestBodyBuffers.push({ data: data, encoding: encoding }); - this._currentRequest.write(data, encoding, callback); - } - // Error when we exceed the maximum body length - else { - this.emit("error", new MaxBodyLengthExceededError()); - this.abort(); - } -}; + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, -// Ends the current native request -RedirectableRequest.prototype.end = function (data, encoding, callback) { - // Shift parameters if necessary - if (typeof data === "function") { - callback = data; - data = encoding = null; - } - else if (typeof encoding === "function") { - callback = encoding; - encoding = null; - } + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', - // Write data if needed and end - if (!data) { - this._ended = this._ending = true; - this._currentRequest.end(null, null, callback); - } - else { - var self = this; - var currentRequest = this._currentRequest; - this.write(data, encoding, function () { - self._ended = true; - currentRequest.end(null, null, callback); - }); - this._ending = true; - } -}; + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { -// Sets a header value on the current native request -RedirectableRequest.prototype.setHeader = function (name, value) { - this._options.headers[name] = value; - this._currentRequest.setHeader(name, value); -}; + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; -// Clears a header value on the current native request -RedirectableRequest.prototype.removeHeader = function (name) { - delete this._options.headers[name]; - this._currentRequest.removeHeader(name); -}; + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; -// Global timeout for all underlying requests -RedirectableRequest.prototype.setTimeout = function (msecs, callback) { - var self = this; + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; - // Destroys the socket on timeout - function destroyOnTimeout(socket) { - socket.setTimeout(msecs); - socket.removeListener("timeout", socket.destroy); - socket.addListener("timeout", socket.destroy); - } + /*------------------------------------------------------------------------*/ - // Sets up a timer to trigger a timeout event - function startTimer(socket) { - if (self._timeout) { - clearTimeout(self._timeout); + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; } - self._timeout = setTimeout(function () { - self.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - // Stops a timeout from triggering - function clearTimer() { - // Clear the timeout - if (self._timeout) { - clearTimeout(self._timeout); - self._timeout = null; + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; } - // Clean up all attached listeners - self.removeListener("abort", clearTimer); - self.removeListener("error", clearTimer); - self.removeListener("response", clearTimer); - if (callback) { - self.removeListener("timeout", callback); - } - if (!self.socket) { - self._currentRequest.removeListener("socket", startTimer); + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; } - } - - // Attach callback if passed - if (callback) { - this.on("timeout", callback); - } - - // Start the timer if or when the socket is opened - if (this.socket) { - startTimer(this.socket); - } - else { - this._currentRequest.once("socket", startTimer); - } - - // Clean up on events - this.on("socket", destroyOnTimeout); - this.on("abort", clearTimer); - this.on("error", clearTimer); - this.on("response", clearTimer); - return this; -}; + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); -// Proxy all other public ClientRequest methods -[ - "flushHeaders", "getHeader", - "setNoDelay", "setSocketKeepAlive", -].forEach(function (method) { - RedirectableRequest.prototype[method] = function (a, b) { - return this._currentRequest[method](a, b); - }; -}); + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; -// Proxy all public ClientRequest properties -["aborted", "connection", "socket"].forEach(function (property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function () { return this._currentRequest[property]; }, - }); -}); + outer: + while (length-- && resIndex < takeCount) { + index += dir; -RedirectableRequest.prototype._sanitizeOptions = function (options) { - // Ensure headers are always present - if (!options.headers) { - options.headers = {}; - } + var iterIndex = -1, + value = array[index]; - // Since http.request treats host as an alias of hostname, - // but the url module interprets host as hostname plus port, - // eliminate the host property to avoid confusion. - if (options.host) { - // Use hostname if set, because it has precedence - if (!options.hostname) { - options.hostname = options.host; - } - delete options.host; - } + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); - // Complete the URL object when necessary - if (!options.pathname && options.path) { - var searchPos = options.path.indexOf("?"); - if (searchPos < 0) { - options.pathname = options.path; - } - else { - options.pathname = options.path.substring(0, searchPos); - options.search = options.path.substring(searchPos); + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; } - } -}; - - -// Executes the next native request (initial or redirect) -RedirectableRequest.prototype._performRequest = function () { - // Load the native protocol - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - this.emit("error", new TypeError("Unsupported protocol " + protocol)); - return; - } - // If specified, use the agent corresponding to the protocol - // (HTTP and HTTPS use different types of agents) - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; - } + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; - // Create the native request and set up its event handlers - var request = this._currentRequest = - nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } + /*------------------------------------------------------------------------*/ - // RFC7230§5.3.1: When making a request directly to an origin server, […] - // a client MUST send only the absolute path […] as the request-target. - this._currentUrl = /^\//.test(this._options.path) ? - url.format(this._options) : - // When making a request to a proxy, […] - // a client MUST send the target URI in absolute-form […]. - this._currentUrl = this._options.path; + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - // End a redirected request - // (The first request must be ended explicitly with RedirectableRequest#end) - if (this._isRedirect) { - // Write the request entity and end - var i = 0; - var self = this; - var buffers = this._requestBodyBuffers; - (function writeNext(error) { - // Only write if this request has not been redirected yet - /* istanbul ignore else */ - if (request === self._currentRequest) { - // Report any write errors - /* istanbul ignore if */ - if (error) { - self.emit("error", error); - } - // Write the next buffer if there are still left - else if (i < buffers.length) { - var buffer = buffers[i++]; - /* istanbul ignore else */ - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } - // End the request if `end` has been called on us - else if (self._ended) { - request.end(); - } + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - }()); - } -}; + } -// Processes a response from the current native request -RedirectableRequest.prototype._processResponse = function (response) { - // Store the redirected response - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode: statusCode, - }); - } + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } - // RFC7231§6.4: The 3xx (Redirection) class of status code indicates - // that further action needs to be taken by the user agent in order to - // fulfill the request. If a Location header field is provided, - // the user agent MAY automatically redirect its request to the URI - // referenced by the Location field value, - // even if the specific status code is not understood. + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } - // If the response is not a redirect; return it as-is - var location = response.headers.location; - if (!location || this._options.followRedirects === false || - statusCode < 300 || statusCode >= 400) { - response.responseUrl = this._currentUrl; - response.redirects = this._redirects; - this.emit("response", response); + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } - // Clean up - this._requestBodyBuffers = []; - return; - } + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } - // The response is a redirect, so abort the current request - abortRequest(this._currentRequest); - // Discard the remainder of the response to avoid waiting for data - response.destroy(); + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } - // RFC7231§6.4: A client SHOULD detect and intervene - // in cyclical redirections (i.e., "infinite" redirection loops). - if (++this._redirectCount > this._options.maxRedirects) { - this.emit("error", new TooManyRedirectsError()); - return; - } + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; - // Store the request headers if applicable - var requestHeaders; - var beforeRedirect = this._options.beforeRedirect; - if (beforeRedirect) { - requestHeaders = Object.assign({ - // The Host header was set by nativeProtocol.request - Host: response.req.getHeader("host"), - }, this._options.headers); - } + /*------------------------------------------------------------------------*/ - // RFC7231§6.4: Automatic redirection needs to done with - // care for methods not known to be safe, […] - // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change - // the request method from POST to GET for the subsequent request. - var method = this._options.method; - if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || - // RFC7231§6.4.4: The 303 (See Other) status code indicates that - // the server is redirecting the user agent to a different resource […] - // A user agent can perform a retrieval request targeting that URI - // (a GET or HEAD request if using HTTP) […] - (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { - this._options.method = "GET"; - // Drop a possible entity and headers related to it - this._requestBodyBuffers = []; - removeMatchingHeaders(/^content-/i, this._options.headers); - } + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - // Drop the Host header, as the redirect might lead to a different host - var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } - // If the redirect is relative, carry over the host of the last request - var currentUrlParts = url.parse(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : - url.format(Object.assign(currentUrlParts, { host: currentHost })); + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } - // Determine the URL of the redirection - var redirectUrl; - try { - redirectUrl = url.resolve(currentUrl, location); - } - catch (cause) { - this.emit("error", new RedirectionError(cause)); - return; - } + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - // Create the redirected request - debug("redirecting to", redirectUrl); - this._isRedirect = true; - var redirectUrlParts = url.parse(redirectUrl); - Object.assign(this._options, redirectUrlParts); + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } - // Drop confidential headers when redirecting to a less secure protocol - // or to a different domain that is not a superdomain - if (redirectUrlParts.protocol !== currentUrlParts.protocol && - redirectUrlParts.protocol !== "https:" || - redirectUrlParts.host !== currentHost && - !isSubdomain(redirectUrlParts.host, currentHost)) { - removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers); - } + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); - // Evaluate the beforeRedirect callback - if (typeof beforeRedirect === "function") { - var responseDetails = { - headers: response.headers, - statusCode: statusCode, - }; - var requestDetails = { - url: currentUrl, - method: method, - headers: requestHeaders, - }; - try { - beforeRedirect(this._options, responseDetails, requestDetails); + return index < 0 ? undefined : data[index][1]; } - catch (err) { - this.emit("error", err); - return; + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; } - this._sanitizeOptions(this._options); - } - // Perform the redirected request - try { - this._performRequest(); - } - catch (cause) { - this.emit("error", new RedirectionError(cause)); - } -}; + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); -// Wraps the key/value object of protocols with redirect functionality -function wrap(protocols) { - // Default settings - var exports = { - maxRedirects: 21, - maxBodyLength: 10 * 1024 * 1024, - }; + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } - // Wrap each protocol - var nativeProtocols = {}; - Object.keys(protocols).forEach(function (scheme) { - var protocol = scheme + ":"; - var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; - var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; - // Executes a request, following redirects - function request(input, options, callback) { - // Parse parameters - if (typeof input === "string") { - var urlStr = input; - try { - input = urlToOptions(new URL(urlStr)); - } - catch (err) { - /* istanbul ignore next */ - input = url.parse(urlStr); - } - } - else if (URL && (input instanceof URL)) { - input = urlToOptions(input); - } - else { - callback = options; - options = input; - input = { protocol: protocol }; - } - if (typeof options === "function") { - callback = options; - options = null; - } + /*------------------------------------------------------------------------*/ - // Set defaults - options = Object.assign({ - maxRedirects: exports.maxRedirects, - maxBodyLength: exports.maxBodyLength, - }, input, options); - options.nativeProtocols = nativeProtocols; + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug("options", options); - return new RedirectableRequest(options, callback); + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } - // Executes a GET request, following redirects - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; } - // Expose the properties on the wrapped protocol - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true }, - }); - }); - return exports; -} + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } -/* istanbul ignore next */ -function noop() { /* empty */ } + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } -// from https://github.com/nodejs/node/blob/master/lib/internal/url.js -function urlToOptions(urlObject) { - var options = { - protocol: urlObject.protocol, - hostname: urlObject.hostname.startsWith("[") ? - /* istanbul ignore next */ - urlObject.hostname.slice(1, -1) : - urlObject.hostname, - hash: urlObject.hash, - search: urlObject.search, - pathname: urlObject.pathname, - path: urlObject.pathname + urlObject.search, - href: urlObject.href, - }; - if (urlObject.port !== "") { - options.port = Number(urlObject.port); - } - return options; -} + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } -function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; } - } - return (lastValue === null || typeof lastValue === "undefined") ? - undefined : String(lastValue).trim(); -} -function createErrorType(code, defaultMessage) { - function CustomError(cause) { - Error.captureStackTrace(this, this.constructor); - if (!cause) { - this.message = defaultMessage; + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } } - else { - this.message = defaultMessage + ": " + cause.message; - this.cause = cause; + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } - } - CustomError.prototype = new Error(); - CustomError.prototype.constructor = CustomError; - CustomError.prototype.name = "Error [" + code + "]"; - CustomError.prototype.code = code; - return CustomError; -} -function abortRequest(request) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.abort(); -} + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } -function isSubdomain(subdomain, domain) { - const dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); -} + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; -// Exports -module.exports = wrap({ http: http, https: https }); -module.exports.wrap = wrap; + /*------------------------------------------------------------------------*/ + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } -/***/ }), + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } -/***/ 64334: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); -var CombinedStream = __nccwpck_require__(85443); -var util = __nccwpck_require__(73837); -var path = __nccwpck_require__(71017); -var http = __nccwpck_require__(13685); -var https = __nccwpck_require__(95687); -var parseUrl = (__nccwpck_require__(57310).parse); -var fs = __nccwpck_require__(57147); -var Stream = (__nccwpck_require__(12781).Stream); -var mime = __nccwpck_require__(43583); -var asynckit = __nccwpck_require__(14812); -var populate = __nccwpck_require__(17142); + this.size = data.size; + return result; + } -// Public API -module.exports = FormData; + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } -// make it a Stream -util.inherits(FormData, CombinedStream); + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } -/** - * Create readable "multipart/form-data" streams. - * Can be used to submit forms - * and file uploads to other web applications. - * - * @constructor - * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream - */ -function FormData(options) { - if (!(this instanceof FormData)) { - return new FormData(options); - } + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } - this._overheadLength = 0; - this._valueLength = 0; - this._valuesToMeasure = []; + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; - CombinedStream.call(this); + /*------------------------------------------------------------------------*/ - options = options || {}; - for (var option in options) { - this[option] = options[option]; - } -} + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; -FormData.LINE_BREAK = '\r\n'; -FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } -FormData.prototype.append = function(field, value, options) { + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } - options = options || {}; + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } - // allow filename as single option - if (typeof options == 'string') { - options = {filename: options}; - } + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } - var append = CombinedStream.prototype.append.bind(this); + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } - // all that streamy business can't handle numbers - if (typeof value == 'number') { - value = '' + value; - } + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } - // https://github.com/felixge/node-form-data/issues/38 - if (util.isArray(value)) { - // Please convert your array into string - // the way web server expects it - this._error(new Error('Arrays are not supported.')); - return; - } + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } - var header = this._multiPartHeader(field, value, options); - var footer = this._multiPartFooter(); + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } - append(header); - append(value); - append(footer); + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } - // pass along options.knownLength - this._trackLength(header, value, options); -}; + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } -FormData.prototype._trackLength = function(header, value, options) { - var valueLength = 0; + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } - // used w/ getLengthSync(), when length is known. - // e.g. for streaming directly from a remote server, - // w/ a known file a size, and not wanting to wait for - // incoming file to finish to get its size. - if (options.knownLength != null) { - valueLength += +options.knownLength; - } else if (Buffer.isBuffer(value)) { - valueLength = value.length; - } else if (typeof value === 'string') { - valueLength = Buffer.byteLength(value); - } + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; - this._valueLength += valueLength; + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } - // @check why add CRLF? does this account for custom/multiple CRLFs? - this._overheadLength += - Buffer.byteLength(header) + - FormData.LINE_BREAK.length; + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } - // empty or either doesn't have path or not an http response or not a stream - if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) { - return; - } + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; - // no need to bother with the length - if (!options.knownLength) { - this._valuesToMeasure.push(value); - } -}; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; -FormData.prototype._lengthRetriever = function(value, callback) { + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); - if (value.hasOwnProperty('fd')) { + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } - // take read range into a account - // `end` = Infinity –> read file till the end - // - // TODO: Looks like there is bug in Node fs.createReadStream - // it doesn't respect `end` options without `start` options - // Fix it when node fixes it. - // https://github.com/joyent/node/issues/7819 - if (value.end != undefined && value.end != Infinity && value.start != undefined) { + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); - // when end specified - // no need to calculate range - // inclusive, starts with 0 - callback(null, value.end + 1 - (value.start ? value.start : 0)); + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } - // not that fast snoopy - } else { - // still need to fetch file size from fs - fs.stat(value.path, function(err, stat) { + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } - var fileSize; + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; - if (err) { - callback(err); - return; + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; } + } + return true; + } - // update final size based on the range options - fileSize = stat.size - (value.start ? value.start : 0); - callback(null, fileSize); - }); + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); } - // or http response - } else if (value.hasOwnProperty('httpVersion')) { - callback(null, +value.headers['content-length']); + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; - // or request stream http://github.com/mikeal/request - } else if (value.hasOwnProperty('httpModule')) { - // wait till response come back - value.on('response', function(response) { - value.pause(); - callback(null, +response.headers['content-length']); - }); - value.resume(); + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); - // something else - } else { - callback('Unknown stream'); - } -}; + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } -FormData.prototype._multiPartHeader = function(field, value, options) { - // custom header specified (as string)? - // it becomes responsible for boundary - // (e.g. to handle extra CRLFs on .NET servers) - if (typeof options.header == 'string') { - return options.header; - } + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); - var contentDisposition = this._getContentDisposition(value, options); - var contentType = this._getContentType(value, options); + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); - var contents = ''; - var headers = { - // add custom disposition as third element or keep it two elements if not - 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), - // if no content type. allow it to be empty array - 'Content-Type': [].concat(contentType || []) - }; + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } - // allow custom headers. - if (typeof options.header == 'object') { - populate(headers, options.header); - } + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; - var header; - for (var prop in headers) { - if (!headers.hasOwnProperty(prop)) continue; - header = headers[prop]; + while (++index < length) { + var value = array[index], + current = iteratee(value); - // skip nullish headers. - if (header == null) { - continue; + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; } - // convert all headers to arrays. - if (!Array.isArray(header)) { - header = [header]; - } + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; - // add non-empty headers. - if (header.length) { - contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; } - } - - return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; -}; -FormData.prototype._getContentDisposition = function(value, options) { + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } - var filename - , contentDisposition - ; + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; - if (typeof options.filepath === 'string') { - // custom filepath for relative paths - filename = path.normalize(options.filepath).replace(/\\/g, '/'); - } else if (options.filename || value.name || value.path) { - // custom filename take precedence - // formidable and the browser add a name property - // fs- and request- streams have path property - filename = path.basename(options.filename || value.name || value.path); - } else if (value.readable && value.hasOwnProperty('httpVersion')) { - // or try http response - filename = path.basename(value.client._httpMessage.path || ''); - } + predicate || (predicate = isFlattenable); + result || (result = []); - if (filename) { - contentDisposition = 'filename="' + filename + '"'; - } + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } - return contentDisposition; -}; + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); -FormData.prototype._getContentType = function(value, options) { + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); - // use custom content-type above all - var contentType = options.contentType; + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } - // or try `name` from formidable, browser - if (!contentType && value.name) { - contentType = mime.lookup(value.name); - } + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } - // or try `path` from fs-, request- streams - if (!contentType && value.path) { - contentType = mime.lookup(value.path); - } + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } - // or if it's http-reponse - if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { - contentType = value.headers['content-type']; - } + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); - // or guess it from the filepath or filename - if (!contentType && (options.filepath || options.filename)) { - contentType = mime.lookup(options.filepath || options.filename); - } + var index = 0, + length = path.length; - // fallback to the default content type if `value` is not simple value - if (!contentType && typeof value == 'object') { - contentType = FormData.DEFAULT_CONTENT_TYPE; - } + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } - return contentType; -}; + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } -FormData.prototype._multiPartFooter = function() { - return function(next) { - var footer = FormData.LINE_BREAK; + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } - var lastPart = (this._streams.length === 0); - if (lastPart) { - footer += this._lastBoundary(); + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; } - next(footer); - }.bind(this); -}; - -FormData.prototype._lastBoundary = function() { - return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; -}; + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } -FormData.prototype.getHeaders = function(userHeaders) { - var header; - var formHeaders = { - 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() - }; + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } - for (header in userHeaders) { - if (userHeaders.hasOwnProperty(header)) { - formHeaders[header.toLowerCase()] = userHeaders[header]; + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); } - } - return formHeaders; -}; + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; -FormData.prototype.setBoundary = function(boundary) { - this._boundary = boundary; -}; + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; -FormData.prototype.getBoundary = function() { - if (!this._boundary) { - this._generateBoundary(); - } + var index = -1, + seen = caches[0]; - return this._boundary; -}; + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; -FormData.prototype.getBuffer = function() { - var dataBuffer = new Buffer.alloc( 0 ); - var boundary = this.getBoundary(); + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } - // Create the form content. Add Line breaks to the end of data. - for (var i = 0, len = this._streams.length; i < len; i++) { - if (typeof this._streams[i] !== 'function') { + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } - // Add content to the buffer. - if(Buffer.isBuffer(this._streams[i])) { - dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]); - }else { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]); - } + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } - // Add break after content. - if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) { - dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] ); - } + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; } - } - // Add the footer and return the Buffer object. - return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] ); -}; + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } -FormData.prototype._generateBoundary = function() { - // This generates a 50 character boundary similar to those used by Firefox. - // They are optimized for boyer-moore parsing. - var boundary = '--------------------------'; - for (var i = 0; i < 24; i++) { - boundary += Math.floor(Math.random() * 10).toString(16); - } + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } - this._boundary = boundary; -}; + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } -// Note: getLengthSync DOESN'T calculate streams length -// As workaround one can calculate file size manually -// and add it as knownLength option -FormData.prototype.getLengthSync = function() { - var knownLength = this._overheadLength + this._valueLength; + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); - // Don't get confused, there are 3 "internal" streams for each keyval pair - // so it basically checks if there is any value added to the form - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; - // https://github.com/form-data/form-data/issues/40 - if (!this.hasKnownLength()) { - // Some async length retrievers are present - // therefore synchronous length calculation is false. - // Please use getLength(callback) to get proper length - this._error(new Error('Cannot calculate proper length in synchronous way.')); - } + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; - return knownLength; -}; + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); -// Public API to check if length of added values is known -// https://github.com/form-data/form-data/issues/196 -// https://github.com/form-data/form-data/issues/262 -FormData.prototype.hasKnownLength = function() { - var hasKnownLength = true; + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; - if (this._valuesToMeasure.length) { - hasKnownLength = false; - } + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } - return hasKnownLength; -}; + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } -FormData.prototype.getLength = function(cb) { - var knownLength = this._overheadLength + this._valueLength; + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; - if (this._streams.length) { - knownLength += this._lastBoundary().length; - } + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; - if (!this._valuesToMeasure.length) { - process.nextTick(cb.bind(this, null, knownLength)); - return; - } + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } - asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) { - if (err) { - cb(err); - return; + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } - values.forEach(function(length) { - knownLength += length; - }); + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } - cb(null, knownLength); - }); -}; + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } -FormData.prototype.submit = function(params, cb) { - var request - , options - , defaults = {method: 'post'} - ; + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } - // parse provided url if it's string - // or treat it as options object - if (typeof params == 'string') { + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } - params = parseUrl(params); - options = populate({ - port: params.port, - path: params.pathname, - host: params.hostname, - protocol: params.protocol - }, defaults); + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } - // use custom params - } else { + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; - options = populate(params, defaults); - // if no port provided use default one - if (!options.port) { - options.port = options.protocol == 'https:' ? 443 : 80; + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; } - } - // put that good code in getHeaders to some use - options.headers = this.getHeaders(params.headers); + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } - // https if specified, fallback to http in any other case - if (options.protocol == 'https:') { - request = https.request(options); - } else { - request = http.request(options); - } + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; - // get content length and fire away - this.getLength(function(err, length) { - if (err && err !== 'Unknown stream') { - this._error(err); - return; + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; } - // add content length - if (length) { - request.setHeader('Content-Length', length); + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; } - this.pipe(request); - if (cb) { - var onResponse; - - var callback = function (error, responce) { - request.removeListener('error', callback); - request.removeListener('response', onResponse); - - return cb.call(this, error, responce); + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; - - onResponse = callback.bind(this, null); - - request.on('error', callback); - request.on('response', onResponse); } - }.bind(this)); - - return request; -}; - -FormData.prototype._error = function(err) { - if (!this.error) { - this.error = err; - this.pause(); - this.emit('error', err); - } -}; -FormData.prototype.toString = function () { - return '[object FormData]'; -}; + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } -/***/ }), + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); -/***/ 17142: -/***/ ((module) => { + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; -// populates missing values -module.exports = function(dst, src) { + var isCommon = newValue === undefined; - Object.keys(src).forEach(function(prop) - { - dst[prop] = dst[prop] || src[prop]; - }); + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); - return dst; -}; + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } -/***/ }), + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } -/***/ 31621: -/***/ ((module) => { + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); -"use strict"; + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } -module.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf('--'); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -}; + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; -/***/ }), + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); -/***/ 63287: -/***/ ((__unused_webpack_module, exports) => { + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } -"use strict"; + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; -Object.defineProperty(exports, "__esModule", ({ value: true })); + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } -function isObject(o) { - return Object.prototype.toString.call(o) === '[object Object]'; -} + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; -function isPlainObject(o) { - var ctor,prot; + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } - if (isObject(o) === false) return false; + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } - // If has modified constructor - ctor = o.constructor; - if (ctor === undefined) return true; + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); - // If has modified prototype - prot = ctor.prototype; - if (isObject(prot) === false) return false; + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); - // Most likely a plain Object - return true; -} + return result; + } -exports.isPlainObject = isPlainObject; + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } -/***/ }), + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } -/***/ 90250: -/***/ (function(module, exports, __nccwpck_require__) { + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); -/* module decorator */ module = __nccwpck_require__.nmd(module); -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -;(function() { + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; - /** Used as the semantic version number. */ - var VERSION = '4.17.21'; + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } - /** Error message constants. */ - var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function', - INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } - /** Used to associate wrap methods with their bit flags. */ - var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] - ]; + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - domExcTag = '[object DOMException]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]', - weakSetTag = '[object WeakSet]'; + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, - reUnescapedHtml = /[&<>"']/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } - /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } - /** Used to match leading whitespace. */ - var reTrimStart = /^\s+/; + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; - /** Used to match a single whitespace character. */ - var reWhitespace = /\s/; + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; - /** Used to match wrap detail comments. */ - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } - /** - * Used to validate the `validate` option in `_.template` variable. - * - * Forbids characters which could potentially change the meaning of the function argument definition: - * - "()," (modification of function parameters) - * - "=" (default value) - * - "[]{}" (destructuring of function parameters) - * - "/" (beginning of a comment) - * - whitespace - */ - var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; - /** - * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; + while (++index < length) { + var array = arrays[index], + othIndex = -1; - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + buffer.copy(result); + return result; + } - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' - ]; + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; - /** Detect free variable `exports`. */ - var freeExports = true && exports && !exports.nodeType && exports; + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } - /** Detect free variable `module`. */ - var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; + var index = -1, + length = props.length; - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; + while (++index < length) { + var key = props[index]; - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; - if (types) { - return types; + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } } + return object; + } - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } - /* Node.js helper references. */ - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, - nodeIsDate = nodeUtil && nodeUtil.isDate, - nodeIsMap = nodeUtil && nodeUtil.isMap, - nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, - nodeIsSet = nodeUtil && nodeUtil.isSet, - nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } - /*--------------------------------------------------------------------------*/ + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; } - return func.apply(thisArg, args); - } - /** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); } - return accumulator; - } - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; } - return array; - } - /** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; } - return array; - } - /** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); } + return wrapper; } - return true; - } - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; - } + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); - /** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} [array] The array to inspect. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } + return chr[methodName]() + trailing; + }; } - return false; - } - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - while (++index < length) { - result[index] = iteratee(array[index], index, array); + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; } - return result; - } - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); - while (++index < length) { - array[offset + index] = values[index]; + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; } - return array; - } - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); - /** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as - * the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); } + return wrapper; } - return false; - } - /** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - var asciiSize = baseProperty('length'); + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } - /** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function asciiToArray(string) { - return string.split(''); - } + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; - /** - * Splits an ASCII `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; - /** - * The base implementation of methods like `_.findKey` and `_.findLastKey`, - * without support for iteratee shorthands, which iterates over `collection` - * using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = key; - return false; - } - }); - return result; - } + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); } - return -1; - } - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); - } + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); - /** - * This function is like `baseIndexOf` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @param {Function} comparator The comparator invoked per element. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, - length = array.length; + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; - while (++index < length) { - if (comparator(array[index], value)) { - return index; + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); } + return wrapper; } - return -1; - } - - /** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ - function baseIsNaN(value) { - return value !== value; - } - - /** - * The base implementation of `_.mean` and `_.meanBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the mean. - */ - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? (baseSum(array, iteratee) / length) : NAN; - } - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } - /** - * The base implementation of `_.propertyOf` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @returns {Function} Returns the new accessor function. - */ - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined : object[key]; - }; - } + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of - * `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } - /** - * The base implementation of `_.sortBy` which uses `comparer` to define the - * sort order of `array` and replaces criteria objects with their corresponding - * values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); - array.sort(comparer); - while (length--) { - array[length] = array[length].value; + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); } - return array; - } - /** - * The base implementation of `_.sum` and `_.sumBy` without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); } + return wrapper; } - return result; - } - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; } - return result; - } - - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } - /** - * The base implementation of `_.trim`. - * - * @private - * @param {string} string The string to trim. - * @returns {string} Returns the trimmed string. - */ - function baseTrim(string) { - return string - ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') - : string; - } + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } - /** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); - /** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function cacheHas(cache, key) { - return cache.has(key); - } + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; - /** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; - /** - * Gets the number of `placeholder` occurrences in `array`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} placeholder The placeholder to search for. - * @returns {number} Returns the placeholder count. - */ - function countHolders(array, placeholder) { - var length = array.length, - result = 0; + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } - while (length--) { - if (array[length] === placeholder) { - ++result; + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); } - } - return result; - } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; - /** - * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A - * letters to basic Latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; - /** - * Gets the value at `key` of `object`. - * - * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined : object[key]; - } + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); - /** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } - /** - * Checks if `string` contains a word composed of Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } - while (!(data = iterator.next()).done) { - result.push(data.value); + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; } - return result; - } - /** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - /** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } + stack.set(array, other); + stack.set(other, array); - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } } + stack['delete'](array); + stack['delete'](other); + return result; } - return result; - } - /** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; - /** - * Converts `set` to its value-value pairs. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the value-value pairs. - */ - function setToPairs(set) { - var index = -1, - result = Array(set.size); + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); - set.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; - } + case errorTag: + return object.name == other.name && object.message == other.message; - /** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } + case mapTag: + var convert = mapToArray; - /** - * A specialized version of `_.lastIndexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; - } - } - return index; - } + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); - /** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ - function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); - } + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); - } + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedEndIndex(string) { - var index = string.length; + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } - while (index-- && reWhitespace.test(string.charAt(index))) {} - return index; - } + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); - /** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ - function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; - } - return result; - } + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; - /** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; - /** - * Splits a Unicode `string` into an array of its words. - * - * @private - * @param {string} The string to inspect. - * @returns {Array} Returns the words of `string`. - */ - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } - /*--------------------------------------------------------------------------*/ + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } - /** - * Create a new pristine `lodash` function using the `context` object. - * - * @static - * @memberOf _ - * @since 1.1.0 - * @category Util - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // Create a suped-up `defer` in Node.js. - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - var runInContext = (function runInContext(context) { - context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } - /** Built-in constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; - /** Used to detect overreaching core-js shims. */ - var coreJsData = context['__core-js_shared__']; + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; - /** Used to resolve the decompiled source of functions. */ - var funcToString = funcProto.toString; + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } - /** Used to generate unique IDs. */ - var idCounter = 0; + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } - /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { - var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); - return uid ? ('Symbol(src)_1.' + uid) : ''; - }()); + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. */ - var nativeObjectToString = objectProto.toString; + function getMatchData(object) { + var result = keys(object), + length = result.length; - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); + while (length--) { + var key = result[length], + value = object[key]; - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } - /** Built-in value references. */ - var Buffer = moduleExports ? context.Buffer : undefined, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, - symIterator = Symbol ? Symbol.iterator : undefined, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; - var defineProperty = (function() { try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; + value[symToStringTag] = undefined; + var unmasked = true; } catch (e) {} - }()); - /** Mocked built-ins. */ - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, - ctxNow = Date && Date.now !== root.Date.now && Date.now, - ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = Date.now, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; - /* Built-in method references that are verified to be native. */ - var DataView = getNative(context, 'DataView'), - Map = getNative(context, 'Map'), - Promise = getNative(context, 'Promise'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; - /** Used to lookup unminified function names. */ - var realNames = {}; + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; - /** Used to detect maps, sets, and weakmaps. */ - var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; - /*------------------------------------------------------------------------*/ + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chain sequences. Methods that operate on and return arrays, collections, - * and functions can be chained together. Methods that retrieve a single value - * or may return a primitive value will automatically end the chain sequence - * and return the unwrapped value. Otherwise, the value must be unwrapped - * with `_#value`. - * - * Explicit chain sequences, which must be unwrapped with `_#value`, may be - * enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. - * Shortcut fusion is an optimization to merge iteratee calls; this avoids - * the creation of intermediate arrays and can greatly reduce the number of - * iteratee executions. Sections of a chain sequence qualify for shortcut - * fusion if the section is applied to an array and iteratees accept only - * one argument. The heuristic for whether a section qualifies for shortcut - * fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, - * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, - * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, - * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, - * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, - * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, - * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, - * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, - * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, - * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, - * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, - * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, - * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, - * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, - * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, - * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, - * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, - * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, - * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, - * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, - * `zipObject`, `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, - * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, - * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, - * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, - * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, - * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, - * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, - * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, - * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, - * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, - * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, - * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, - * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, - * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, - * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, - * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, - * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, - * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, - * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, - * `upperFirst`, `value`, and `words` + * Extracts wrapper details from the `source` body comment. * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. * - * function square(n) { - * return n * n; - * } + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. * - * var wrapped = _([1, 2, 3]); + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. * - * // Returns a wrapped value. - * var squares = wrapped.map(square); + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * - * _.isArray(squares); - * // => false + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. * - * _.isArray(squares.value()); - * // => true + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; } - return new LodashWrapper(value); + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. + * Checks if `value` is a flattenable `arguments` object or array. * * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; - }()); + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } /** - * The function whose prototype chain sequence wrappers inherit from. + * Checks if `value` is a valid array-like index. * * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ - function baseLodash() { - // No operation performed. + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); } /** - * The base constructor for creating `lodash` wrapper objects. + * Checks if the given arguments are from an iteratee call. * * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable explicit method chain sequences. + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; } /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB) as well as ES2015 template strings. Change the - * following template settings to use alternative delimiters. + * Checks if `value` is a property name and not a property path. * - * @static - * @memberOf _ - * @type {Object} + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - 'interpolate': reInterpolate, + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type {string} - */ - 'variable': '', + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type {Object} - */ - 'imports': { + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type {Function} - */ - '_': lodash + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; } - }; + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; - /*------------------------------------------------------------------------*/ + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private - * @constructor - * @param {*} value The value to wrap. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; + function isStrictComparable(value) { + return value === value && !isObject(value); } /** - * Creates a clone of the lazy wrapper object. + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. * * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; } /** - * Reverses the direction of lazy iteration. + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; return result; } /** - * Extracts the unwrapped value from its lazy wrapper. + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. * * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - outer: - while (length-- && resIndex < takeCount) { - index += dir; + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); - var iterIndex = -1, - value = array[index]; + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); + return data; + } - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); } - result[resIndex++] = value; } return result; } - // Ensure `LazyWrapper` is an instance of `baseLodash`. - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } - /*------------------------------------------------------------------------*/ + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } /** - * Creates a hash object. + * Gets the parent value at `path` of `object`. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. */ - function Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } + return array; } /** - * Removes all key-value entries from the hash. + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. * * @private - * @name clear - * @memberOf Hash + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. */ - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } + var setData = shortOut(baseSetData); /** - * Removes `key` and its value from the hash. + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. */ - function hashDelete(key) { - var result = this.has(key) && delete this.__data__[key]; - this.size -= result ? 1 : 0; - return result; - } + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; /** - * Gets the hash value for `key`. + * Sets the `toString` method of `func` to return `string`. * * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. */ - function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; - } + var setToString = shortOut(baseSetToString); /** - * Checks if a hash value for `key` exists. + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. * * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. */ - function hashHas(key) { - var data = this.__data__; - return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** - * Sets the hash `key` to `value`. + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. * * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. */ - function hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; - } + function shortOut(func) { + var count = 0, + lastCalled = 0; - // Add methods to `Hash`. - Hash.prototype.clear = hashClear; - Hash.prototype['delete'] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); - /*------------------------------------------------------------------------*/ + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } /** - * Creates an list cache object. + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. */ - function ListCache(entries) { + function shuffleSelf(array, size) { var index = -1, - length = entries == null ? 0 : entries.length; + length = array.length, + lastIndex = length - 1; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; } + array.length = size; + return array; } /** - * Removes all key-value entries from the list cache. + * Converts `string` to a property path array. * * @private - * @name clear - * @memberOf ListCache + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. */ - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); /** - * Removes `key` and its value from the list cache. + * Converts `value` to a string key if it's not a string or symbol. * * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. */ - function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; } - --this.size; - return true; + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** - * Gets the list cache value for `key`. + * Converts `func` to its source code. * * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. */ - function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; } /** - * Checks if a list cache value for `key` exists. + * Updates wrapper `details` based on `bitmask` flags. * * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. */ - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); } /** - * Sets the list cache `key` to `value`. + * Creates a clone of `wrapper`. * * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); } - return this; + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; } - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - /*------------------------------------------------------------------------*/ /** - * Creates a map cache object to store key-value pairs. + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); } + return result; } /** - * Removes all key-value entries from the map. + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. * - * @private - * @name clear - * @memberOf MapCache + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] */ - function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; } /** - * Removes `key` and its value from the map. + * Creates a new array concatenating `array` with any additional arrays + * and/or values. * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] */ - function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** - * Gets the map value for `key`. + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] */ - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); /** - * Checks if a map value for `key` exists. + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] */ - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); /** - * Sets the map `key` to `value`. + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] */ - function mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; - } - - // Add methods to `MapCache`. - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype['delete'] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - - /*------------------------------------------------------------------------*/ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example * - * Creates an array cache object to store unique values. + * _.drop([1, 2, 3]); + * // => [2, 3] * - * @private - * @constructor - * @param {Array} [values] The values to cache. + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] */ - function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); } /** - * Adds `value` to the array cache. + * Creates a slice of `array` with `n` elements dropped from the end. * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - - /** - * Checks if `value` is in the array cache. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function setCacheHas(value) { - return this.__data__.has(value); - } - - // Add methods to `SetCache`. - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a stack cache object to store key-value pairs. + * _.dropRight([1, 2, 3]); + * // => [1, 2] * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ - function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; - } - - /** - * Removes all key-value entries from the stack. + * _.dropRight([1, 2, 3], 2); + * // => [1] * - * @private - * @name clear - * @memberOf Stack + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] */ - function stackClear() { - this.__data__ = new ListCache; - this.size = 0; + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); } /** - * Removes `key` and its value from the stack. + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] */ - function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; } /** - * Gets the stack value for `key`. + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] */ - function stackGet(key) { - return this.__data__.get(key); + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; } /** - * Checks if a stack value for `key` exists. + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] */ - function stackHas(key) { - return this.__data__.has(key); + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); } /** - * Sets the stack `key` to `value`. + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 */ - function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; } - data.set(key, value); - this.size = data.size; - return this; + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); } - // Add methods to `Stack`. - Stack.prototype.clear = stackClear; - Stack.prototype['delete'] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - - /*------------------------------------------------------------------------*/ - /** - * Creates an array of the enumerable property names of the array-like `value`. + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 */ - function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; } - return result; + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** - * A specialized version of `_.sample` for arrays. + * Flattens `array` a single level deep. * - * @private - * @param {Array} array The array to sample. - * @returns {*} Returns the random element. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] */ - function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined; + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; } /** - * A specialized version of `_.sampleSize` for arrays. + * Recursively flattens `array`. * - * @private - * @param {Array} array The array to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] */ - function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; } /** - * A specialized version of `_.shuffle` for arrays. + * Recursively flatten `array` up to `depth` times. * - * @private - * @param {Array} array The array to shuffle. - * @returns {Array} Returns the new shuffled array. + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] */ - function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); } /** - * This function is like `assignValue` except that it doesn't assign - * `undefined` values. + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; } + return result; } /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. + * Gets the first element of `array`. * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - baseAssignValue(object, key, value); - } + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; } /** - * Gets the index at which the `key` is found in `array` of key-value pairs. + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. * - * @private + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array * @param {Array} array The array to inspect. - * @param {*} key The key to search for. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; } - return -1; + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); } /** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. + * Gets all but the last element of `array`. * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. + * _.initial([1, 2, 3]); + * // => [1, 2] */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; } /** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] */ - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); /** - * The base implementation of `assignValue` and `assignMergeValue` without - * value checks. + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] */ - function baseAssignValue(object, key, value) { - if (key == '__proto__' && defineProperty) { - defineProperty(object, key, { - 'configurable': true, - 'enumerable': true, - 'value': value, - 'writable': true - }); + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; } else { - object[key] = value; + mapped.pop(); } - } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); /** - * The base implementation of `_.at` without support for individual paths. + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths to pick. - * @returns {Array} Returns the picked elements. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] */ - function baseAt(object, paths) { - var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); - while (++index < length) { - result[index] = skip ? undefined : get(object, paths[index]); + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); } - return result; - } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); /** - * The base implementation of `_.clamp` which doesn't coerce arguments. + * Converts all elements in `array` into a string separated by `separator`. * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; - } - - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); } /** - * The base implementation of `_.conforms` which doesn't clone `source`. + * Gets the last element of `array`. * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new spec function. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 */ - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; } /** - * The base implementation of `_.conformsTo` which accepts `props` to check. + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property predicates to conform to. - * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 */ - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; - - if ((value === undefined && !(key in object)) || !predicate(value)) { - return false; - } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } - return true; + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); } /** - * The base implementation of `_.delay` and `_.defer` which accepts `args` - * to provide to `func`. + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Array} args The arguments to provide to `func`. - * @returns {number|Object} Returns the timer id or timeout object. + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); + var pull = baseRest(pullAll); - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; } /** - * The base implementation of `_.forEach` without support for iteratee shorthands. + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] */ - var baseEach = createBaseEach(baseForOwn); + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } /** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ - var baseEachRight = createBaseEach(baseForOwnRight, true); + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } /** - * The base implementation of `_.every` without support for iteratee shorthands. + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + return result; - } + }); /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] */ - function baseExtremum(array, iteratee, comparator) { + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } var index = -1, + indexes = [], length = array.length; + predicate = getIteratee(predicate, 3); while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { - var computed = current, - result = value; + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); } } + basePullAt(array, indexes); return result; } /** - * The base implementation of `_.fill` without an iteratee call guard. + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] */ - function baseFill(array, value, start, end) { - var length = array.length; + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); } - return array; + return baseSlice(array, start, end); } /** - * The base implementation of `_.filter` without support for iteratee shorthands. + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; + function sortedIndex(array, value) { + return baseSortedIndex(array, value); } /** - * The base implementation of `_.flatten` with support for restricting flattening. + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 */ - function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 */ - var baseFor = createBaseFor(); + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 */ - var baseForRight = createBaseFor(true); + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; } /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from `props`. + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the function names. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; } /** - * The base implementation of `_.get` without support for default values. + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] */ - function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined; + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; } /** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. + * Gets all but the first element of `array`. * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; } /** - * The base implementation of `getTag` without fallbacks for buggy environments. + * Creates a slice of `array` with `n` elements taken from the beginning. * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] */ - function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; + function take(array, n, guard) { + if (!(array && array.length)) { + return []; } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); } /** - * The base implementation of `_.gt` which doesn't coerce arguments. + * Creates a slice of `array` with `n` elements taken from the end. * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, - * else `false`. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] */ - function baseGt(value, other) { - return value > other; + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); } /** - * The base implementation of `_.has` without support for deep paths. + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] */ - function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; } /** - * The base implementation of `_.hasIn` without support for deep paths. + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] */ - function baseHasIn(object, key) { - return object != null && key in Object(object); + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; } /** - * The base implementation of `_.inRange` which doesn't coerce arguments. + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); - } + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] */ - function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - seen = caches[0]; - - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; } - return result; - } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); /** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ - function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; - } - - /** - * The base implementation of `_.invoke` without support for individual - * method arguments. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined : apply(func, object, args); - } + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); /** - * The base implementation of `_.isArguments`. + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] */ - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; } /** - * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] */ - function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; } /** - * The base implementation of `_.isDate` without Node.js optimizations. + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] */ - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; + function unzip(array) { + if (!(array && array.length)) { + return []; } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); } /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; } - if (!isSameTag) { - return false; + var result = unzip(array); + if (iteratee == null) { + return result; } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); } /** - * The base implementation of `_.isMap` without Node.js optimizations. + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] */ - function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; } - return true; - } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); /** - * The base implementation of `_.isNative` without bad shim checks. + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - function baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); - } + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); /** - * The base implementation of `_.isRegExp` without Node.js optimizations. + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] */ - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } + var zip = baseRest(unzip); /** - * The base implementation of `_.isSet` without Node.js optimizations. + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } */ - function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); } /** - * The base implementation of `_.isTypedArray` without Node.js optimizations. + * This method is like `_.zipObject` except that it supports property paths. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ - function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); } /** - * The base implementation of `_.iteratee`. + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] */ - function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ /** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' */ - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } + function chain(value) { + var result = lodash(value); + result.__chain__ = true; return result; } /** - * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] */ - function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; + function tap(value, interceptor) { + interceptor(value); + return value; } /** - * The base implementation of `_.lt` which doesn't coerce arguments. + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, - * else `false`. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] */ - function baseLt(value, other) { - return value < other; + function thru(value, interceptor) { + return interceptor(value); } /** - * The base implementation of `_.map` without support for iteratee shorthands. + * This method is the wrapper version of `_.at`. * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined }); - return result; + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); } /** - * The base implementation of `_.matches` which doesn't clone `source`. + * Executes the chain sequence and returns the wrapped result. * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); } /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } */ - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; } /** - * The base implementation of `_.merge` without support for multiple sources. + * Enables the wrapper to be iterable. * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack); - if (isObject(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer - ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) - : undefined; - - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); + function wrapperToIterator() { + return this; } /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. + * Creates a clone of the chain sequence planting `value` as the wrapped value. * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer - ? customizer(objValue, srcValue, (key + ''), object, source, stack) - : undefined; - - var isCommon = newValue === undefined; - - if (isCommon) { - var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); + function wrapperPlant(value) { + var result, + parent = this; - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray(objValue)) { - newValue = objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } - else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } - else { - newValue = []; - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } - else { - isCommon = false; + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; } + var previous = clone; + parent = parent.__wrapped__; } - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack['delete'](srcValue); - } - assignMergeValue(object, key, newValue); + previous.__wrapped__ = value; + return result; } /** - * The base implementation of `_.nth` which doesn't coerce arguments. + * This method is the wrapper version of `_.reverse`. * - * @private - * @param {Array} array The array to query. - * @param {number} n The index of the element to return. - * @returns {*} Returns the nth element of `array`. - */ - function baseNth(array, n) { - var length = array.length; - if (!length) { - return; - } - n += n < 0 ? length : 0; - return isIndex(n, length) ? array[n] : undefined; - } - - /** - * The base implementation of `_.orderBy` without param guards. + * **Note:** This method mutates the wrapped array. * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] */ - function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee) { - if (isArray(iteratee)) { - return function(value) { - return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); - } - } - return iteratee; + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined }); - } else { - iteratees = [identity]; + return new LodashWrapper(wrapped, this.__chain__); } - - var index = -1; - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); + return this.thru(reverse); } /** - * The base implementation of `_.pick` without support for individual - * property identifiers. + * Executes the chain sequence to resolve the unwrapped value. * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @returns {Object} Returns the new object. + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] */ - function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); } + /*------------------------------------------------------------------------*/ + /** - * The base implementation of `_.pickBy` without support for iteratee shorthands. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). * - * @private - * @param {Object} object The source object. - * @param {string[]} paths The property paths to pick. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } */ - function basePickBy(object, paths, predicate) { - var index = -1, - length = paths.length, - result = {}; - - while (++index < length) { - var path = paths[index], - value = baseGet(object, path); - - if (predicate(value, path)) { - baseSet(result, castPath(path, object), value); - } + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); } - return result; - } + }); /** - * A specialized version of `baseProperty` which supports deep paths. + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); } /** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] */ - function basePullAll(array, values, iteratee, comparator) { - var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; - - if (array === values) { - values = copyArray(values); - } - if (iteratee) { - seen = arrayMap(array, baseUnary(iteratee)); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); } /** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; - } + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); /** - * The base implementation of `_.random` without support for returning - * floating-point numbers. + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } + var findLast = createFind(findLastIndex); /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); } /** - * The base implementation of `_.repeat` which doesn't coerce arguments. + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] */ - function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); } /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); } /** - * The base implementation of `_.sample`. + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. * - * @private - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ - function baseSample(collection) { - return arraySample(values(collection)); + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); } /** - * The base implementation of `_.sampleSize` without param guards. + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. * - * @private - * @param {Array|Object} collection The collection to sample. - * @param {number} n The number of elements to sample. - * @returns {Array} Returns the random elements. + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. */ - function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); } /** - * The base implementation of `_.set`. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } */ - function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); } - path = castPath(path, object); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; + }); - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return object; - } + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); } - return object; + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** - * The base implementation of `setData` without support for hot loop shorting. + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); /** - * The base implementation of `setToString` without support for hot loop shorting. + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); - }; + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); /** - * The base implementation of `_.shuffle`. + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). * - * @private - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] */ - function baseShuffle(collection) { - return shuffleSelf(values(collection)); + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); } /** - * The base implementation of `_.slice` without an iteratee call guard. + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; } - end = end > length ? length : end; - if (end < 0) { - end += length; + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; } - return result; + return baseOrderBy(collection, iteratees, orders); } /** - * The base implementation of `_.some` without support for iteratee shorthands. + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). * - * @private + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ - function baseSome(collection, predicate) { - var result; + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] */ - function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array == null ? low : array.length; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] */ - function baseSortedIndexBy(array, value, iteratee, retHighest) { - var low = 0, - high = array == null ? 0 : array.length; - if (high === 0) { - return 0; - } - - value = iteratee(value); - var valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); - - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); } /** - * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without - * support for iteratee shorthands. + * Gets a random element from `collection`. * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 */ - function baseSortedUniq(array, iteratee) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!index || !eq(computed, seen)) { - var seen = computed; - result[resIndex++] = value === 0 ? 0 : value; - } - } - return result; + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); } /** - * The base implementation of `_.toNumber` which doesn't ensure correct - * conversions of binary, hexadecimal, or octal string values. + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. * - * @private - * @param {*} value The value to process. - * @returns {number} Returns the number. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] */ - function baseToNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); } - return +value; + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); } /** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] */ - function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); } /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; + function size(collection) { + if (collection == null) { + return 0; } - else { - seen = iteratee ? [] : result; + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; } - return result; + return baseKeys(collection).length; } /** - * The base implementation of `_.unset`. + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The property path to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; - } - - /** - * The base implementation of `_.update`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to update. - * @param {Function} updater The function to produce the updated value. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); - } - - /** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. + * _.some([null, 0, 'yes', false], Boolean); + * // => true * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} - - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); + return func(collection, getIteratee(predicate, 3)); } /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ - function baseXor(arrays, iteratee, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; } - var index = -1, - result = Array(length); - - while (++index < length) { - var array = arrays[index], - othIndex = -1; - - while (++othIndex < length) { - if (othIndex != index) { - result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); - } - } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; } - return baseUniq(baseFlatten(result, 1), iteratee, comparator); - } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ /** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). * - * @private - * @param {Array} props The property identifiers. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. */ - function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; + var now = ctxNow || function() { + return root.Date.now(); + }; - while (++index < length) { - var value = index < valsLength ? values[index] : undefined; - assignFunc(result, props[index], value); - } - return result; - } + /*------------------------------------------------------------------------*/ /** - * Casts `value` to an empty array if it's not an array like object. + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. * - * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. */ - function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; } /** - * Casts `value` to `identity` if it's not a function. + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] */ - function castFunction(value) { - return typeof value == 'function' ? value : identity; + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** - * Casts `value` to a path array if it's not one. + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. * - * @private - * @param {*} value The value to inspect. - * @param {Object} [object] The object to query keys on. - * @returns {Array} Returns the cast property path array. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. */ - function castPath(value, object) { - if (isArray(value)) { - return value; + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); } - return isKey(value, object) ? [value] : stringToPath(toString(value)); + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; } /** - * A `baseRest` alias which can be replaced with `identity` by module - * replacement plugins. + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. * - * @private - * @type {Function} - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. - */ - var castRest = baseRest; - - /** - * Casts `array` to a slice if it's needed. + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ - function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); - } - - /** - * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. * - * @private - * @param {number|Object} id The timer id or timeout object of the timer to clear. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' */ - var clearTimeout = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); /** - * Creates a clone of `buffer`. + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; - } + return createWrap(key, bitmask, object, partials, holders); + }); /** - * Creates a clone of `arrayBuffer`. + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; return result; } /** - * Creates a clone of `dataView`. + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - - /** - * Creates a clone of `regexp`. + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; return result; } /** - * Creates a clone of the `symbol` object. + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - /** - * Creates a clone of `typedArray`. + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - /** - * Compares values to sort them in ascending order. + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); - - var othIsDefined = other !== undefined, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); - - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; - } - - /** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; - } + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; } - return result; - } - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @params {boolean} [isCurried] Specify composing for a curried function. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; - while (++argsIndex < rangeLength) { - result[argsIndex] = args[argsIndex]; + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); } - return result; - } - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; + function trailingEdge(time) { + timerId = undefined; - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; } - return array; - } - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } - var index = -1, - length = props.length; + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } - while (++index < length) { - var key = props[index]; + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; + lastArgs = arguments; + lastThis = this; + lastCallTime = time; - if (newValue === undefined) { - newValue = source[key]; + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); } + return result; } - return object; + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; } /** - * Copies own symbols of `source` to `object`. + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); /** - * Copies own and inherited symbols of `source` to `object`. + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. */ - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); - } + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); /** - * Creates a function like `_.groupBy`. + * Creates a function that invokes `func` with arguments reversed. * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] */ - function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, getIteratee(iteratee, 2), accumulator); - }; + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); } /** - * Creates a function like `_.assign`. + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; */ - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } + if (cache.has(key)) { + return cache.get(key); } - return object; - }); + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; } + // Expose `MapCache`. + memoize.Cache = MapCache; + /** - * Creates a `baseEach` or `baseEachRight` function. + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); } - return collection; + return !predicate.apply(this, args); }; } /** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; + length = nativeMin(args.length, funcsLength); - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); } - return object; - }; - } + return apply(func, this, args); + }); + }); /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; - } - - /** - * Creates a function like `_.lowerFirst`. + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new case function. + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = hasUnicode(string) - ? stringToArray(string) - : undefined; - - var chr = strSymbols - ? strSymbols[0] - : string.charAt(0); - - var trailing = strSymbols - ? castSlice(strSymbols, 1).join('') - : string.slice(1); - - return chr[methodName]() + trailing; - }; - } + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); /** - * Creates a function like `_.camelCase`. + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); - }; - } + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] */ - function createCtor(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); /** - * Creates a function that wraps `func` to enable currying. + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' */ - function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - if (length < arity) { - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, undefined, - args, holders, undefined, undefined, arity - length); - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return apply(fn, this, args); + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); } - return wrapper; + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); } /** - * Creates a `_.find` or `_.findLast` function. + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * - * @private - * @param {Function} findIndexFunc The function to find the collection index. - * @returns {Function} Returns the new find function. + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 */ - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object(collection); - if (!isArrayLike(collection)) { - var iteratee = getIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; - }; + return apply(func, this, otherArgs); + }); } /** - * Creates a `_.flow` or `_.flowRight` function. + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); */ - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; + function throttle(func, wait, options) { + var leading = true, + trailing = true; - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing }); } /** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided - * to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] */ - function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, - isBind = bitmask & WRAP_BIND_FLAG, - isBindKey = bitmask & WRAP_BIND_KEY_FLAG, - isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), - isFlip = bitmask & WRAP_FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtor(func); - - function wrapper() { - var length = arguments.length, - args = Array(length), - index = length; - - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, bitmask, createHybrid, wrapper.placeholder, thisArg, - args, newHolders, argPos, ary, arity - length - ); - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; + function unary(func) { + return ary(func, 1); + } - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); } + /*------------------------------------------------------------------------*/ + /** - * Creates a function like `_.invertBy`. + * Casts `value` as an array if it's not one. * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true */ - function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; } /** - * Creates a function that performs a mathematical operation on two values. + * Creates a shallow clone of `value`. * - * @private - * @param {Function} operator The function to perform the operation. - * @param {number} [defaultValue] The value used for `undefined` arguments. - * @returns {Function} Returns the new mathematical operation function. + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true */ - function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result; - if (value === undefined && other === undefined) { - return defaultValue; - } - if (value !== undefined) { - result = value; - } - if (other !== undefined) { - if (result === undefined) { - return other; - } - if (typeof value == 'string' || typeof other == 'string') { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result = operator(value, other); - } - return result; - }; + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); } /** - * Creates a function like `_.over`. + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new over function. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 */ - function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. + * This method is like `_.clone` except that it recursively clones `value`. * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false */ - function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } /** - * Creates a function that wraps `func` to invoke it with the `this` binding - * of `thisArg` and `partials` prepended to the arguments it receives. + * This method is like `_.cloneWith` except that it recursively clones `value`. * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to - * the new function. - * @returns {Function} Returns the new wrapped function. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 */ - function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } /** - * Creates a `_.range` or `_.rangeRight` function. + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toFinite(start); - if (end === undefined) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); - return baseRange(start, end, step, fromRight); - }; + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); } /** - * Creates a function that performs a relational operation on two values. + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. * - * @private - * @param {Function} operator The function to perform the operation. - * @returns {Function} Returns the new relational operation function. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true */ - function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == 'string' && typeof other == 'string')) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; + function eq(value, other) { + return value === other || (value !== value && other !== other); } /** - * Creates a function that wraps `func` to continue currying. + * Checks if `value` is greater than `other`. * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder value. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to - * the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false */ - function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); - - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); - } - var newData = [ - func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, - newHoldersRight, argPos, ary, arity - ]; - - var result = wrapFunc.apply(undefined, newData); - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return setWrapToString(result, func, bitmask); - } + var gt = createRelationalOperation(baseGt); /** - * Creates a function like `_.round`. + * Checks if `value` is greater than or equal to `other`. * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision && nativeIsFinite(number)) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); - - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; - } + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); /** - * Creates a set object of `values`. + * Checks if `value` is likely an `arguments` object. * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); }; /** - * Creates a `_.toPairs` or `_.toPairsIn` function. + * Checks if `value` is classified as an `Array` object. * - * @private - * @param {Function} keysFunc The function to get the keys of a given object. - * @returns {Function} Returns the new pairs function. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false */ - function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); - }; - } + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask flags. - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * 512 - `_.flip` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false */ - function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func); - - var newData = [ - func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, - argPos, ary, arity - ]; - - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result = createPartial(func, bitmask, thisArg, partials); - } else { - result = createHybrid.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setWrapToString(setter(result, newData), func, bitmask); + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); } /** - * Used by `_.defaults` to customize its `_.assignIn` use to assign properties - * of source objects to the destination object for all destination properties - * that resolve to `undefined`. + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false */ - function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); } /** - * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source - * objects into destination objects that are passed thru. + * Checks if `value` is classified as a boolean primitive or object. * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged - * counterparts. - * @returns {*} Returns the value to assign. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false */ - function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - // Recursively merge objects and arrays (susceptible to call stack limits). - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); - stack['delete'](srcValue); - } - return objValue; + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); } /** - * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain - * objects. + * Checks if `value` is a buffer. * - * @private - * @param {*} value The value to inspect. - * @param {string} key The key of the property to inspect. - * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false */ - function customOmitClone(value) { - return isPlainObject(value) ? undefined : value; - } + var isBuffer = nativeIsBuffer || stubFalse; /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. + * Checks if `value` is classified as a `Date` object. * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false */ - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Check that cyclic values are equal. - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. + * Checks if `value` is likely a DOM element. * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false */ - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. + * Checks if `value` is an empty object, collection, map, or set. * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false */ - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; + function isEmpty(value) { + if (value == null) { + return true; } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; } - // Check that cyclic values are equal. - var objStacked = stack.get(object); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object; + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); + if (isPrototype(value)) { + return !baseKeys(value).length; } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; } } - stack['delete'](object); - stack['delete'](other); - return result; + return true; } /** - * A specialized version of `baseRest` which flattens the rest array. + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @returns {Function} Returns the new function. + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false */ - function flatRest(func) { - return setToString(overRest(func, undefined, flatten), func + ''); + function isEqual(value, other) { + return baseIsEqual(value, other); } /** - * Creates an array of own enumerable property names and symbols of `object`. + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true */ - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false */ - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** - * Gets metadata for `func`. + * Checks if `value` is a finite primitive number. * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } /** - * Gets the name of `func`. + * Checks if `value` is classified as a `Function` object. * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false */ - function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } + function isFunction(value) { + if (!isObject(value)) { + return false; } - return result; + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** - * Gets the argument placeholder value for `func`. + * Checks if `value` is an integer. * - * @private - * @param {Function} func The function to inspect. - * @returns {*} Returns the placeholder value. + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false */ - function getHolder(func) { - var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; - return object.placeholder; + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); } /** - * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, - * this function returns the custom method, otherwise it returns `baseIteratee`. - * If arguments are provided, the chosen function is invoked with them and - * its result is returned. + * Checks if `value` is a valid array-like length. * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** - * Gets the data for `map`. + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false */ - function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); } /** - * Gets the property names, values, and compare flags of `object`. + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false */ - function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; + function isObjectLike(value) { + return value != null && typeof value == 'object'; } /** - * Gets the native function at `key` of `object`. + * Checks if `value` is classified as a `Map` object. * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false */ - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; - } + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false */ - function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); } /** - * Creates an array of the own enumerable symbols of `object`. + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true */ - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); - }; + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } /** - * Creates an array of the own and inherited enumerable symbols of `object`. + * Checks if `value` is `NaN`. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; - }; + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } /** - * Gets the `toStringTag` of `value`. + * Checks if `value` is a pristine native function. * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - var getTag = baseGetTag; - - // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. - if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); } /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. + * Checks if `value` is `null`. * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false */ - function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; + function isNull(value) { + return value === null; } /** - * Extracts wrapper details from the `source` body comment. + * Checks if `value` is `null` or `undefined`. * - * @private - * @param {string} source The source to inspect. - * @returns {Array} Returns the wrapper details. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false */ - function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; + function isNil(value) { + return value == null; } /** - * Checks if `path` exists on `object`. + * Checks if `value` is classified as a `Number` primitive or object. * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false */ - function hasPath(object, path, hasFunc) { - path = castPath(path, object); - - var index = -1, - length = path.length, - result = false; - - while (++index < length) { - var key = toKey(path[index]); - if (!(result = object != null && hasFunc(object, key))) { - break; - } - object = object[key]; - } - if (result || ++index != length) { - return result; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isArguments(object)); + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); } /** - * Initializes an array clone. + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; } - return result; + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; } /** - * Initializes an object clone. + * Checks if `value` is classified as a `RegExp` object. * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false */ - function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; - } + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** - * Initializes an object clone based on its `toStringTag`. + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return new Ctor; - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return new Ctor; - - case symbolTag: - return cloneSymbol(object); - } + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** - * Inserts wrapper `details` in a comment at the top of the `source` body. + * Checks if `value` is classified as a `Set` object. * - * @private - * @param {string} source The source to modify. - * @returns {Array} details The details to insert. - * @returns {string} Returns the modified source. + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false */ - function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); - } + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** - * Checks if `value` is a flattenable `arguments` object or array. + * Checks if `value` is classified as a `String` primitive or object. * - * @private + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false */ - function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** - * Checks if `value` is a valid array-like index. + * Checks if `value` is classified as a `Symbol` primitive or object. * - * @private + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); } /** - * Checks if the given arguments are from an iteratee call. + * Checks if `value` is classified as a typed array. * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, - * else `false`. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { - return eq(object[index], value); - } - return false; - } + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** - * Checks if `value` is a property name and not a property path. + * Checks if `value` is `undefined`. * - * @private + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false */ - function isKey(value, object) { - if (isArray(value)) { - return false; - } - var type = typeof value; - if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object)); + function isUndefined(value) { + return value === undefined; } /** - * Checks if `value` is suitable for use as unique object key. + * Checks if `value` is classified as a `WeakMap` object. * - * @private + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false */ - function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; } /** - * Checks if `func` has a lazy counterpart. + * Checks if `value` is classified as a `WeakSet` object. * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, - * else `false`. + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false */ - function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; - - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; } /** - * Checks if `func` has its source masked. + * Checks if `value` is less than `other`. * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false */ - function isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); - } + var lt = createRelationalOperation(baseLt); /** - * Checks if `func` is capable of being masked. + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + * _.lte(3, 1); + * // => false */ - var isMaskable = coreJsData ? isFunction : stubFalse; + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); /** - * Checks if `value` is likely a prototype object. + * Converts `value` to an array. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); - return value === proto; + return func(value); } /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * Converts `value` to a finite number. * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 */ - function isStrictComparable(value) { - return value === value && !isObject(value); + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; } /** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. + * Converts `value` to an integer. * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 */ - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; } /** - * A specialized version of `_.memoize` which clears the memoized function's - * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * Converts `value` to an integer suitable for use as the length of an + * array-like object. * - * @private - * @param {Function} func The function to have its output memoized. - * @returns {Function} Returns the new memoized function. + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 */ - function memoizeCapped(func) { - var result = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - - var cache = result.cache; - return result; + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } /** - * Merges the function metadata of `source` into `data`. + * Converts `value` to a number. * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and - * `_.rearg` modify function arguments, making the order in which they are - * executed important, preventing the merging of metadata. However, we make - * an exception for a safe combined case where curried functions have `_.ary` - * and or `_.rearg` applied. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - - var isCombo = - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || - ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || - ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & WRAP_BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : value; - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + function toNumber(value) { + if (typeof value == 'number') { + return value; } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = value; + if (isSymbol(value)) { + return NAN; } - // Use source `ary` if it's smaller. - if (srcBitmask & WRAP_ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; + if (typeof value != 'string') { + return value === 0 ? value : +value; } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); } /** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } */ - function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; + function toPlainObject(value) { + return copyObject(value, keysIn(value)); } /** - * Converts `value` to a string using `Object.prototype.toString`. + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. * - * @private + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } - - /** - * A specialized version of `baseRest` which transforms the rest array. + * @returns {number} Returns the converted integer. + * @example * - * @private - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @param {Function} transform The rest array transform. - * @returns {Function} Returns the new function. - */ - function overRest(func, start, transform) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = transform(array); - return apply(func, this, otherArgs); - }; - } - - /** - * Gets the parent value at `path` of `object`. + * _.toSafeInteger(3.2); + * // => 3 * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 */ - function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); } /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; + function toString(value) { + return value == null ? '' : baseToString(value); } + /*------------------------------------------------------------------------*/ + /** - * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } */ - function safeGet(object, key) { - if (key === 'constructor' && typeof object[key] === 'function') { + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); return; } - - if (key == '__proto__') { - return; + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } } + }); - return object[key]; - } + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); /** - * Sets metadata for `func`. + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity - * function to avoid garbage collection pauses in V8. See - * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) - * for more details. + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - var setData = shortOut(baseSetData); + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); /** - * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @returns {number|Object} Returns the timer id or timeout object. + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - var setTimeout = ctxSetTimeout || function(func, wait) { - return root.setTimeout(func, wait); - }; + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); /** - * Sets the `toString` method of `func` to return `string`. + * Creates an array of values corresponding to `paths` of `object`. * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] */ - var setToString = shortOut(baseSetToString); + var at = flatRest(baseAt); /** - * Sets the `toString` method of `wrapper` to mimic the source of `reference` - * with wrapper details in a comment at the top of the source body. + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. * - * @private - * @param {Function} wrapper The function to modify. - * @param {Function} reference The reference function. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Function} Returns `wrapper`. + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true */ - function setWrapToString(wrapper, reference, bitmask) { - var source = (reference + ''); - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); } /** - * Creates a function that'll short out and invoke `identity` instead - * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` - * milliseconds. + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - function shortOut(func) { - var count = 0, - lastCalled = 0; + var defaults = baseRest(function(object, sources) { + object = Object(object); - return function() { - var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined, arguments); - }; - } + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } - /** - * A specialized version of `_.shuffle` which mutates and sets the size of `array`. - * - * @private - * @param {Array} array The array to shuffle. - * @param {number} [size=array.length] The size of `array`. - * @returns {Array} Returns `array`. - */ - function shuffleSelf(array, size) { - var index = -1, - length = array.length, - lastIndex = length - 1; + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; - size = size === undefined ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; - array[rand] = array[index]; - array[index] = value; + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } } - array.length = size; - return array; - } - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - var stringToPath = memoizeCapped(function(string) { - var result = []; - if (string.charCodeAt(0) === 46 /* . */) { - result.push(''); - } - string.replace(rePropName, function(match, number, quote, subString) { - result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; + return object; }); /** - * Converts `value` to a string key if it's not a string or symbol. + * This method is like `_.defaults` except that it recursively assigns + * default properties. * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ - function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /** - * Converts `func` to its source code. + * **Note:** This method mutates `object`. * - * @private - * @param {Function} func The function to convert. - * @returns {string} Returns the source code. - */ - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; - } - - /** - * Updates wrapper `details` based on `bitmask` flags. + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example * - * @private - * @returns {Array} details The details to modify. - * @param {number} bitmask The bitmask flags. See `createWrap` for more details. - * @returns {Array} Returns `details`. + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } */ - function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = '_.' + pair[0]; - if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); - } + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); /** - * Creates a clone of `wrapper`. + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' */ - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } - /*------------------------------------------------------------------------*/ - /** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. * * @static * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the new array of chunks. + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. * @example * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' */ - function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight * @example * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ - function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn * @example * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * console.log(other); - * // => [1, 2, 3, [4]] + * Foo.prototype.c = 3; * - * console.log(array); - * // => [1] + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** - * Creates an array of `array` values not included in the other given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. - * - * **Note:** Unlike `_.pullAll`, this method returns a new array. + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.without, _.xor + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight * @example * - * _.difference([2, 1], [2, 3]); - * // => [1] + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ - var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; - }); + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } /** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). - * - * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn * @example * - * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [1.2] + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ - var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) - : []; - }); + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The order and - * references of result values are determined by the first array. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * Creates an array of function property names from own enumerable properties + * of `object`. * * @static + * @since 0.1.0 * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn * @example * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] */ - var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) - : []; - }); + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } /** - * Creates a slice of `array` with `n` elements dropped from the beginning. + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. * * @static * @memberOf _ - * @since 0.5.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions * @example * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } * - * _.drop([1, 2, 3], 5); - * // => [] + * Foo.prototype.c = _.constant('c'); * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] */ - function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); } /** - * Creates a slice of `array` with `n` elements dropped from the end. + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. * @example * - * _.dropRight([1, 2, 3]); - * // => [1, 2] + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * - * _.dropRight([1, 2, 3], 2); - * // => [1] + * _.get(object, 'a[0].b.c'); + * // => 3 * - * _.dropRight([1, 2, 3], 5); - * // => [] + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] + * _.get(object, 'a.b.c', 'default'); + * // => 'default' */ - function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; } /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). + * Checks if `path` is a direct property of `object`. * * @static + * @since 0.1.0 * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] + * _.has(object, 'a'); + * // => true * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] + * _.has(object, 'a.b'); + * // => true * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] + * _.has(object, ['a', 'b']); + * // => true * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] + * _.has(other, 'a'); + * // => false */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; + function has(object, path) { + return object != null && hasPath(object, path, baseHas); } /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). + * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] + * _.hasIn(object, 'a'); + * // => true * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] + * _.hasIn(object, 'a.b'); + * // => true * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] + * _.hasIn(object, ['a', 'b']); + * // => true * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] + * _.hasIn(object, 'b'); + * // => false */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); } /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. * * @static * @memberOf _ - * @since 3.2.0 - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. * @example * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] + * var object = { 'a': 1, 'b': 2, 'c': 1 }; * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] + * _.invert(object); + * // => { '1': 'c', '2': 'b' } */ - function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); } - return baseFill(array, value, start, end); - } + + result[value] = key; + }, constant(identity)); /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). * * @static * @memberOf _ - * @since 1.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. * @example * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 + * var object = { 'a': 1, 'b': 2, 'c': 1 }; * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; } - return baseFindIndex(array, getIteratee(predicate, 3), index); - } + }, getIteratee); /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. + * Invokes the method at `path` of `object`. * * @static * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the found element, else `-1`. + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. * @example * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] */ - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** - * Flattens `array` a single level deep. + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. * @example * - * _.flatten([1, [2, [3, [4]], 5]]); - * // => [1, 2, [3, [4]], 5] + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** - * Recursively flattens `array`. + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). * * @static * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues * @example * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; } /** - * Recursively flatten `array` up to `depth` times. + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). * * @static * @memberOf _ - * @since 4.4.0 - * @category Array - * @param {Array} array The array to flatten. - * @param {number} [depth=1] The maximum recursion depth. - * @returns {Array} Returns the new flattened array. + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys * @example * - * var array = [1, [2, [3, [4]], 5]]; + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; * - * _.flattenDepth(array, 1); - * // => [1, 2, [3, [4]], 5] + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * - * _.flattenDepth(array, 2); - * // => [1, 2, 3, [4], 5] + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined ? 1 : toInteger(depth); - return baseFlatten(array, depth); + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; } /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. * @example * - * _.fromPairs([['a', 1], ['b', 2]]); - * // => { 'a': 1, 'b': 2 } + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ - function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); /** - * Gets the first element of `array`. + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 0.1.0 - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. * @example * - * _.head([1, 2, 3]); - * // => 1 + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } * - * _.head([]); - * // => undefined + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } */ - function head(array) { - return (array && array.length) ? array[0] : undefined; - } + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the - * offset from the end of `array`. + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. * * @static - * @memberOf _ * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. * @example * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 + * var object = { 'a': 1, 'b': '2', 'c': 3 }; * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } - return baseIndexOf(array, value, index); - } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); /** - * Gets all but the last element of `array`. + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. * @example * - * _.initial([1, 2, 3]); - * // => [1, 2] + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } */ - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); } /** - * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order and references of result values are - * determined by the first array. + * Creates an object composed of the picked `object` properties. * * @static - * @memberOf _ * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of intersecting values. + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. * @example * - * _.intersection([2, 1], [2, 3]); - * // => [2] + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } */ - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); }); /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. The order and references of result values are - * determined by the first array. The iteratee is invoked with one argument: - * (value). + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of intersecting values. + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. * @example * - * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); - * // => [2.1] + * var object = { 'a': 1, 'b': '2', 'c': 3 }; * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } */ - var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); + function pickBy(object, predicate) { + if (object == null) { + return {}; } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee, 2)) - : []; - }); + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The order and references - * of result values are determined by the first array. The comparator is - * invoked with two arguments: (arrVal, othVal). + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. * * @static + * @since 0.1.0 * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of intersecting values. + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. * @example * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' */ - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); + function result(object, path, defaultValue) { + path = castPath(path, object); - comparator = typeof comparator == 'function' ? comparator : undefined; - if (comparator) { - mapped.pop(); + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; - }); + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } /** - * Converts all elements in `array` into a string separated by `separator`. + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. * @example * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ - function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); - } - - /** - * Gets the last element of `array`. + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 * - * _.last([1, 2, 3]); - * // => 3 + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined; + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); } /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. * @example * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 + * var object = {}; * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } */ - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); } /** - * Gets the element at index `n` of `array`. If `n` is negative, the nth - * element from the end is returned. + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. * * @static * @memberOf _ - * @since 4.11.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=0] The index of the element to return. - * @returns {*} Returns the nth element of `array`. + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. * @example * - * var array = ['a', 'b', 'c', 'd']; + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * _.nth(array, 1); - * // => 'b' + * Foo.prototype.c = 3; * - * _.nth(array, -2); - * // => 'c'; + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ - function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; - } + var toPairs = createToPairs(keys); /** - * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` - * to remove elements from an array by predicate. + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. * * @static * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. * @example * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * _.pull(array, 'a', 'c'); - * console.log(array); - * // => ['b', 'b'] + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ - var pull = baseRest(pullAll); + var toPairsIn = createToPairs(keysIn); /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. * @example * - * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] * - * _.pullAll(array, ['a', 'c']); - * console.log(array); - * // => ['b', 'b'] + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; } /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. The iteratee is invoked with one argument: (value). + * Removes the property at `path` of `object`. * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee, 2)) - : array; + function unset(object, path) { + return object == null ? true : baseUnset(object, path); } /** - * This method is like `_.pullAll` except that it accepts `comparator` which - * is invoked to compare elements of `array` to `values`. The comparator is - * invoked with two arguments: (arrVal, othVal). + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). * - * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns `array`. + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. * @example * - * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * - * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); - * console.log(array); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 */ - function pullAllWith(array, values, comparator) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, undefined, comparator) - : array; + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); } /** - * Removes elements from `array` corresponding to `indexes` and returns an - * array of removed elements. + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). * - * **Note:** Unlike `_.at`, this method mutates `array`. + * **Note:** This method mutates `object`. * * @static * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove. - * @returns {Array} Returns the new array of removed elements. + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. * @example * - * var array = ['a', 'b', 'c', 'd']; - * var pulled = _.pullAt(array, [1, 3]); - * - * console.log(array); - * // => ['a', 'c'] + * var object = {}; * - * console.log(pulled); - * // => ['b', 'd'] + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } */ - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); - - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); - - return result; - }); + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked - * with three arguments: (value, index, array). + * Creates an array of the own enumerable string keyed property values of `object`. * - * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` - * to pull elements from an array by value. + * **Note:** Non-object values are coerced to objects. * * @static + * @since 0.1.0 * @memberOf _ - * @since 2.0.0 - * @category Array - * @param {Array} array The array to modify. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array of removed elements. + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. * @example * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * console.log(array); - * // => [1, 3] + * Foo.prototype.c = 3; * - * console.log(evens); - * // => [2, 4] + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); } /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). + * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to modify. - * @returns {Array} Returns `array`. + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. * @example * - * var array = [1, 2, 3]; + * function Foo() { + * this.a = 1; + * this.b = 2; + * } * - * _.reverse(array); - * // => [3, 2, 1] + * Foo.prototype.c = 3; * - * console.log(array); - * // => [3, 2, 1] + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) */ - function reverse(array) { - return array == null ? array : nativeReverse.call(array); + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); } + /*------------------------------------------------------------------------*/ + /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of - * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are - * returned. + * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; } - return baseSlice(array, start, end); + return baseClamp(toNumber(number), lower, upper); } /** - * Uses a binary search to determine the lowest index at which `value` - * should be inserted into `array` in order to maintain its sort order. + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight * @example * - * _.sortedIndex([30, 50], 40); - * // => 1 - */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } - - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). + * _.inRange(3, 2, 4); + * // => true * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example + * _.inRange(4, 8); + * // => true * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * _.inRange(4, 2); + * // => false * - * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 0 + * _.inRange(2, 2); + * // => false * - * // The `_.property` iteratee shorthand. - * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); - * // => 0 - */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); - } - - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. + * _.inRange(1.2, 2); + * // => true * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example + * _.inRange(5.2, 4); + * // => false * - * _.sortedIndexOf([4, 5, 5, 5, 6], 5); - * // => 1 + * _.inRange(-3, -2, -6); + * // => true */ - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); } - return -1; + number = toNumber(number); + return baseInRange(number, start, end); } /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. * * @static * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. * @example * - * _.sortedLastIndex([4, 5, 5, 5, 6], 5); - * // => 4 + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); } + /*------------------------------------------------------------------------*/ + /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. * @example * - * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * _.camelCase('Foo Bar'); + * // => 'fooBar' * - * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); - * // => 1 + * _.camelCase('--foo-bar--'); + * // => 'fooBar' * - * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); - * // => 1 + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); - } + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. + * Converts the first character of `string` to upper case and the remaining + * to lower case. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. * @example * - * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); - * // => 3 + * _.capitalize('FRED'); + * // => 'Fred' */ - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); } /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. * @example * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] + * _.deburr('déjà vu'); + * // => 'deja vu' */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. + * Checks if `string` ends with the given target string. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. * @example * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.3] + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee, 2)) - : []; + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; } /** - * Gets all but the first element of `array`. + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. * * @static + * @since 0.1.0 * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. * @example * - * _.tail([1, 2, 3]); - * // => [2, 3] + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' */ - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; } /** - * Creates a slice of `array` with `n` elements taken from the beginning. + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. * @example * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; } /** - * Creates a slice of `array` with `n` elements taken from the end. + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {Array} Returns the slice of `array`. + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. * @example * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] + * _.kebabCase('fooBar'); + * // => 'foo-bar' * - * _.takeRight([1, 2, 3], 0); - * // => [] + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' */ - function takeRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); - } + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). + * Converts `string`, as space separated words, to lower case. * * @static * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. * @example * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' * - * _.takeRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['fred', 'pebbles'] + * _.lowerCase('fooBar'); + * // => 'foo bar' * - * // The `_.matches` iteratee shorthand. - * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['pebbles'] + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeRightWhile(users, ['active', false]); - * // => objects for ['fred', 'pebbles'] + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example * - * // The `_.property` iteratee shorthand. - * _.takeRightWhile(users, 'active'); - * // => [] + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; - } + var lowerFirst = createCaseFirst('toLowerCase'); /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ * @since 3.0.0 - * @category Array - * @param {Array} array The array to query. - * @param {Function} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. * @example * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.takeWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matches` iteratee shorthand. - * _.takeWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['barney'] + * _.pad('abc', 8); + * // => ' abc ' * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeWhile(users, ['active', false]); - * // => objects for ['barney', 'fred'] + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' * - * // The `_.property` iteratee shorthand. - * _.takeWhile(users, 'active'); - * // => [] + * _.pad('abc', 3); + * // => 'abc' */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); } /** - * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. * @example * - * _.union([2], [1, 2]); - * // => [2, 1] + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' */ - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. Result values are chosen from the first - * array in which the value occurs. The iteratee is invoked with one argument: - * (value). + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. * @example * - * _.unionBy([2.1], [1.2, 2.3], Math.floor); - * // => [2.1, 1.2] + * _.padStart('abc', 6); + * // => ' abc' * - * // The `_.property` iteratee shorthand. - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' */ - var unionBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); - }); + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. Result values are chosen from - * the first array in which the value occurs. The comparator is invoked - * with two arguments: (arrVal, othVal). + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. * @example * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * _.parseInt('08'); + * // => 8 * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] */ - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); - }); + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. The order of result values is determined by the order they occur - * in the array. + * Repeats the given string `n` times. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. * @example * - * _.uniq([2, 1, 2]); - * // => [2, 1] + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' */ - function uniq(array) { - return (array && array.length) ? baseUniq(array) : []; + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); } /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The order of result values is determined by the - * order they occur in the array. The iteratee is invoked with one argument: - * (value). + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' */ - function uniqBy(array, iteratee) { - return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); } /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The order of result values is - * determined by the order they occur in the array.The comparator is invoked - * with two arguments: (arrVal, othVal). + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ - * @since 4.0.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. * @example * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' */ - function uniqWith(array, comparator) { - comparator = typeof comparator == 'function' ? comparator : undefined; - return (array && array.length) ? baseUniq(array, undefined, comparator) : []; - } + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ - * @since 1.2.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. * @example * - * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); - * // => [['a', 1, true], ['b', 2, false]] - * - * _.unzip(zipped); - * // => [['a', 'b'], [1, 2], [true, false]] + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] */ - function unzip(array) { - if (!(array && array.length)) { + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { return []; } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); + } + return string.split(separator, limit); } /** - * This method is like `_.unzip` except that it accepts `iteratee` to specify - * how regrouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ - * @since 3.8.0 - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine - * regrouped values. - * @returns {Array} Returns the new array of regrouped elements. + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. * @example * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - return arrayMap(result, function(group) { - return apply(iteratee, undefined, group); - }); - } + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); /** - * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.pull`, this method returns a new array. + * Checks if `string` starts with the given target string. * * @static * @memberOf _ - * @since 0.1.0 - * @category Array - * @param {Array} array The array to inspect. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.xor + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. * @example * - * _.without([2, 1, 2, 3], 1, 2); - * // => [3] + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true */ - var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } /** - * Creates an array of unique values that is the - * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the given arrays. The order of result values is determined by the order - * they occur in the arrays. + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static + * @since 0.1.0 * @memberOf _ - * @since 2.4.0 - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of filtered values. - * @see _.difference, _.without + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. * @example * - * _.xor([2, 1], [2, 3]); - * // => [1, 3] + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': '